diff --git a/flake.nix b/flake.nix index b18a276..238b8f4 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ # Overlay to add systant to pkgs overlays.default = final: prev: { - systant = final.callPackage ./nix/package.nix { }; + systant = final.callPackage ./nix/package.nix { src = self; }; }; } // diff --git a/nix/package.nix b/nix/package.nix index 15eda2f..25bbbae 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -4,6 +4,7 @@ stdenv, bun, cacert, + src, # passed from flake.nix }: let @@ -14,15 +15,7 @@ let pname = "systant-deps"; version = "0.1.0"; - src = lib.fileset.toSource { - root = ./..; - fileset = lib.fileset.unions [ - ./../package.json - ./../bun.lock - ]; - }; - - nativeBuildInputs = [ bun cacert ]; + inherit src; buildPhase = '' export HOME=$TMPDIR @@ -33,6 +26,8 @@ let cp -r node_modules $out ''; + nativeBuildInputs = [ bun cacert ]; + outputHashMode = "recursive"; outputHashAlgo = "sha256"; # To update: nix build .#systant 2>&1 | grep 'got:' @@ -43,15 +38,7 @@ stdenv.mkDerivation { pname = "systant"; version = "0.1.0"; - src = lib.fileset.toSource { - root = ./..; - fileset = lib.fileset.unions [ - ./../index.ts - ./../src - ./../package.json - ./../tsconfig.json - ]; - }; + inherit src; nativeBuildInputs = [ bun ];