Skip to content

Commit ea7c9b4

Browse files
committed
Properly filter the rust source
1 parent de28d23 commit ea7c9b4

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

packages.nix

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@
33
lib ? pkgs.lib,
44
}:
55
let
6-
# This project's `.gitignore` implemented for cleanSource.
7-
filterGitignore =
8-
orig_path: type:
9-
let
10-
baseName = baseNameOf (toString orig_path);
11-
in
12-
!(baseName == "target" && type == "directory")
13-
|| lib.hasSuffix ".rs.bk" baseName
14-
|| baseName == ".nixos-test-history"
15-
|| (baseName == ".direnv" && type == "directory");
16-
17-
cleanSourceWithGitignore =
18-
src:
19-
lib.cleanSourceWith {
20-
src = lib.cleanSource src;
21-
filter = filterGitignore;
22-
};
23-
246
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
257
in
268
{
@@ -36,7 +18,15 @@ in
3618
rustPlatform.buildRustPackage {
3719
pname = "system-manager";
3820
version = cargoManifest.version;
39-
src = cleanSourceWithGitignore ./.;
21+
src = lib.fileset.toSource {
22+
root = ./.;
23+
fileset = lib.fileset.unions [
24+
./Cargo.toml
25+
./Cargo.lock
26+
./src
27+
];
28+
};
29+
4030
cargoLock.lockFile = ./Cargo.lock;
4131
buildInputs = [ dbus ];
4232
nativeBuildInputs = [

0 commit comments

Comments
 (0)