flake: make src use fileset.union instead of all files (#28)

Nix rebuilds the whole thing when some source changed, but since some of the files are not used at all first make a source folder with just the necessary files
This commit is contained in:
Noa Aarts 2024-10-22 19:40:32 +02:00 committed by GitHub
parent 8d867cf8f2
commit 2869412050
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,6 +26,7 @@
({ pkgs, fpkgs, ... }:
let
toolchain = fpkgs.minimal.toolchain;
fs = pkgs.lib.fileset;
in
rec {
default = flurry;
@ -34,7 +35,16 @@
pname = "flurry";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./Cargo.lock
./Cargo.toml
./flake.nix
./flake.lock
./src
];
};
};
});
devShells = forAllSystems