Skip to content

Commit aac62b3

Browse files
committed
flake: improve src filtering for rust packages
1 parent d272808 commit aac62b3

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

flake.lock

+9-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
url = "github:ipetkov/crane";
66
inputs.nixpkgs.follows = "nixpkgs";
77
};
8-
gitignore = {
9-
url = "github:hercules-ci/gitignore.nix";
10-
inputs.nixpkgs.follows = "nixpkgs";
11-
};
8+
nix-filter.url = "github:numtide/nix-filter";
129
fenix = {
1310
url = "github:nix-community/fenix";
1411
inputs.nixpkgs.follows = "nixpkgs";

modules/rust.nix

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
craneLib = inputs.crane.lib.${system}.overrideToolchain rustToolchain.toolchain;
66
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
77
commonArgs = {
8-
src = inputs.gitignore.lib.gitignoreSource ./..;
8+
src = inputs.nix-filter.lib.filter {
9+
root = ./..;
10+
include = [
11+
"nxy-common"
12+
"nxy-cli"
13+
"nxy-agent"
14+
"nxy-server"
15+
"Cargo.toml"
16+
"Cargo.lock"
17+
];
18+
};
919

1020
# enable unstable tokio `tracing` feature
1121
RUSTFLAGS = "--cfg tokio_unstable";

0 commit comments

Comments
 (0)