From 08bf13cc32ec651d8d78ddfe0f04dd5c6619ec6d Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 19 Jan 2026 20:30:06 -0800 Subject: [PATCH] fix: pass src from flake to package.nix Relative paths in package.nix don't resolve correctly when the flake is used as an input in another flake. Pass src explicitly from the flake instead. Co-Authored-By: Claude Opus 4.5 --- flake.nix | 2 +- nix/package.nix | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) 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 ];