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 <noreply@anthropic.com>
This commit is contained in:
ryan 2026-01-19 20:30:06 -08:00
parent af4606c40b
commit 08bf13cc32
2 changed files with 6 additions and 19 deletions

View File

@ -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; };
};
}
//

View File

@ -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 ];