Filter src in flake

This commit is contained in:
Sapphire
2025-09-29 08:43:13 +02:00
committed by xytovl
parent db66b0dbb7
commit 0ec2cd5a3e
+15 -1
View File
@@ -26,7 +26,21 @@
];
package = pkgs.enableDebugging (pkgs.wivrn.overrideAttrs (finalAttrs: oldAttrs: {
src = ./.;
# Filter the directories and files we don't need to keep to avoid needless rebuilds
src = lib.cleanSourceWith {
filter = name: type: let
baseName = baseNameOf (toString name);
in
(lib.cleanSourceFilter name type) &&
!(
(type == "directory" && (
baseName == ".direnv"
|| baseName == ".cxx"
|| lib.hasPrefix "build" baseName))
|| baseName == ".envrc"
);
src = ./.;
};
version = "next";
# Because src is just a folder path and not a set from a fetcher, it doesn't need to be unpacked, so having a postUnpack throws an error.