diff --git a/ci.nix b/ci.nix index 8fc5b46..af1552f 100644 --- a/ci.nix +++ b/ci.nix @@ -9,7 +9,7 @@ # then your CI will be able to build and cache only those packages for # which this is possible. -{ pkgs ? import { } }: +{ pkgs ? import ./flake-compat.nix { src = ./.; } }: with builtins; diff --git a/flake-compat.nix b/flake-compat.nix new file mode 100644 index 0000000..68c4f5c --- /dev/null +++ b/flake-compat.nix @@ -0,0 +1,12 @@ +{ src, system ? builtins.currentSystem or "unknown-system" }: + +let + lockFilePath = "${src}/flake.lock"; + lockFile = builtins.fromJSON (builtins.readFile lockFilePath); + nixpkgs = lockFile.nodes.nixpkgs.locked; + tarball = fetchTarball { + url = "https://github.com/${nixpkgs.owner}/${nixpkgs.repo}/archive/${nixpkgs.rev}.zip"; + sha256 = nixpkgs.narHash; + }; +in +import tarball { inherit system; }