diff options
author | Ryan Lahfa | 2024-04-17 14:25:55 +0200 |
---|---|---|
committer | Ryan Lahfa | 2024-04-17 14:25:55 +0200 |
commit | 75efc0213100f405fa64f3362e2fc4a73d09f61e (patch) | |
tree | e3c0e49059fb3f0477289308e1b903f6bf06b65d /default.nix | |
parent | 23da71768c03d955c916635bfc5c9d5806a80187 (diff) |
feat(nix): support non-Flakes users
Not all Nix users can make use of Flakes.
This adds the compatibility for non-Flakes users.
Signed-off-by: Ryan Lahfa <ryan.lahfa@inria.fr>
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 00000000..d7da8cd1 --- /dev/null +++ b/default.nix @@ -0,0 +1,16 @@ +# This file provides backward compatibility to nix < 2.4 clients +{ system ? builtins.currentSystem }: +let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + + inherit (lock.nodes.flake-compat.locked) owner repo rev narHash; + + flake-compat = fetchTarball { + url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; + sha256 = narHash; + }; + + flake = import flake-compat { inherit system; src = ./.; }; +in +flake.defaultNix + |