From 75efc0213100f405fa64f3362e2fc4a73d09f61e Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Wed, 17 Apr 2024 14:25:55 +0200 Subject: 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 --- shell.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 shell.nix (limited to 'shell.nix') diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..4e0d706e --- /dev/null +++ b/shell.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.shellNix + -- cgit v1.2.3