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:
@@ -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; };
|
||||
};
|
||||
}
|
||||
//
|
||||
|
||||
+5
-18
@@ -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 ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user