From e34d5fb0faf1a910c24a723738a427dbd5c08394 Mon Sep 17 00:00:00 2001 From: Leon Vatthauer Date: Sat, 6 Apr 2024 17:53:34 +0200 Subject: [PATCH] Add hacky nix workaround --- default.nix | 11 +++++++++++ flake.lock | 17 +++++++++++++++++ flake.nix | 6 +++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..f817afa --- /dev/null +++ b/default.nix @@ -0,0 +1,11 @@ +# Make this flake based dir work like a normal derivation: +# https://nixos.wiki/wiki/Flakes#Using_flakes_with_stable_Nix +(import ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in fetchTarball { + url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; + sha256 = lock.nodes.flake-compat.locked.narHash; } +) { + src = ./.; +}).defaultNix diff --git a/flake.lock b/flake.lock index 96c4005..5a6da4f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -36,6 +52,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } diff --git a/flake.nix b/flake.nix index f10eae4..9ef8ccc 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,12 @@ description = "My personal website"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; - outputs = { self, nixpkgs, flake-utils }: + outputs = { self, nixpkgs, flake-utils, flake-compat }: flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in {