Skip to content

Commit

Permalink
Rework source filtering.
Browse files Browse the repository at this point in the history
To actually avoid triggering unnecessary rebuilds when irrelevant files
change.
  • Loading branch information
wsx-udscbt committed Jan 4, 2023
1 parent 426d650 commit f2e8954
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ vendor
vendor.tar
.vscode
*.log
result
/result
16 changes: 16 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
Expand All @@ -14,20 +15,22 @@
};
};

outputs = { self, nixpkgs, flake-utils, crane, fenix }:
outputs = { self, nixpkgs, flake-utils, nix-filter, crane, fenix }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain;

pkgDef = {
src = pkgs.nix-gitignore.gitignoreSource [
"flake.nix"
"flake.lock"
"data"
"debian"
"LICENSE"
] ./.;
src = nix-filter.lib.filter {
root = ./.;
include = [
./src
./Cargo.toml
./Cargo.lock
./resources
];
};
nativeBuildInputs = with pkgs; [ pkg-config autoPatchelfHook ];
buildInputs = with pkgs; [
wayland
Expand Down

0 comments on commit f2e8954

Please sign in to comment.