flake nix-filter for src

This commit is contained in:
Vinzenz Schroeter 2024-11-09 20:04:44 +01:00
parent 36d0daba05
commit 73f3255741
2 changed files with 32 additions and 9 deletions

View file

@ -20,6 +20,21 @@
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1730207686,
"narHash": "sha256-SCHiL+1f7q9TAnxpasriP6fMarWE5H43t25F5/9e28I=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "776e68c1d014c3adde193a18db9d738458cd2ba4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730883749,
@ -39,6 +54,7 @@
"root": {
"inputs": {
"naersk": "naersk",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs"
}
}

View file

@ -7,6 +7,10 @@
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-filter = {
url = "github:numtide/nix-filter";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -14,6 +18,7 @@
self,
nixpkgs,
naersk,
nix-filter,
}:
let
lib = nixpkgs.lib;
@ -37,7 +42,17 @@
in
rec {
servicepoint-simulator = naersk'.buildPackage rec {
src = ./.;
src = nix-filter.lib.filter {
root = ./.;
include = [
./Cargo.toml
./Cargo.lock
./src
./Web437_IBM_BIOS.woff
./README.md
./LICENSE
];
};
nativeBuildInputs = with pkgs; [
pkg-config
makeWrapper
@ -71,14 +86,6 @@
wrapProgram $out/bin/servicepoint-simulator \
--suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
'';
#postFixup = ''
# patchelf $out/bin/servicepoint-simulator --add-rpath ${pkgs.lib.makeLibraryPath buildInputs}
#'';
#postInstall = ''
# patchelf $out/bin/servicepoint-simulator --add-rpath ${pkgs.lib.makeLibraryPath buildInputs}
#'';
};
default = servicepoint-simulator;