default.nix: filter source

This commit is contained in:
Oystein Kristoffer Tveit 2024-10-20 19:48:23 +02:00
parent 0def9bc340
commit 64bcef4307
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 10 additions and 1 deletions

View File

@ -9,7 +9,16 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "greg-ng"; pname = "greg-ng";
version = "0.1.0"; version = "0.1.0";
src = lib.cleanSource ./.; src = builtins.filterSource (path: type: let
baseName = baseNameOf (toString path);
in !(lib.any (b: b) [
(!(lib.cleanSourceFilter path type))
(baseName == "target" && type == "directory")
(baseName == "nix" && type == "directory")
(baseName == "flake.nix" && type == "regular")
(baseName == "flake.lock" && type == "regular")
])) ./.;
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];