Properly filter the rust source
This commit is contained in:
parent
de28d23132
commit
ea7c9b435f
1 changed files with 9 additions and 19 deletions
28
packages.nix
28
packages.nix
|
|
@ -3,24 +3,6 @@
|
||||||
lib ? pkgs.lib,
|
lib ? pkgs.lib,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# This project's `.gitignore` implemented for cleanSource.
|
|
||||||
filterGitignore =
|
|
||||||
orig_path: type:
|
|
||||||
let
|
|
||||||
baseName = baseNameOf (toString orig_path);
|
|
||||||
in
|
|
||||||
!(baseName == "target" && type == "directory")
|
|
||||||
|| lib.hasSuffix ".rs.bk" baseName
|
|
||||||
|| baseName == ".nixos-test-history"
|
|
||||||
|| (baseName == ".direnv" && type == "directory");
|
|
||||||
|
|
||||||
cleanSourceWithGitignore =
|
|
||||||
src:
|
|
||||||
lib.cleanSourceWith {
|
|
||||||
src = lib.cleanSource src;
|
|
||||||
filter = filterGitignore;
|
|
||||||
};
|
|
||||||
|
|
||||||
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +18,15 @@ in
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
pname = "system-manager";
|
pname = "system-manager";
|
||||||
version = cargoManifest.version;
|
version = cargoManifest.version;
|
||||||
src = cleanSourceWithGitignore ./.;
|
src = lib.fileset.toSource {
|
||||||
|
root = ./.;
|
||||||
|
fileset = lib.fileset.unions [
|
||||||
|
./Cargo.toml
|
||||||
|
./Cargo.lock
|
||||||
|
./src
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
buildInputs = [ dbus ];
|
buildInputs = [ dbus ];
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue