add option to add extra paths
Some checks failed
CI / checks (push) Has been cancelled

This commit is contained in:
Robin Appelman 2024-11-21 14:51:05 +01:00
commit 8051d16230

View file

@ -6,10 +6,10 @@
let let
inherit (builtins) elem readFile pathExists isAttrs attrNames match any; inherit (builtins) elem readFile pathExists isAttrs attrNames match any;
inherit (lib) map mkDefault mkIf mkMerge mkOption warnIf assertMsg optionalAttrs types optionalString genAttrs hasInfix intersectLists foldl attrVals; inherit (lib) map mkDefault mkIf mkMerge mkOption warnIf assertMsg optionalAttrs types optionalString genAttrs hasInfix intersectLists foldl attrVals;
inherit (lib.fileset) fileFilter toSource; inherit (lib.fileset) fileFilter toSource unions;
inherit (flakelight.types) fileset function optFunctionTo; inherit (flakelight.types) fileset function optFunctionTo;
filteredSrc = toSource { root = src; inherit (config) fileset; }; filteredSrc = toSource { root = src; fileset = unions (config.extraPaths ++ [config.fileset]); };
cargoToml = fromTOML (readFile (src + /Cargo.toml)); cargoToml = fromTOML (readFile (src + /Cargo.toml));
tomlPackage = cargoToml.package or cargoToml.workspace.package; tomlPackage = cargoToml.package or cargoToml.workspace.package;
hasMsrv = tomlPackage ? rust-version; hasMsrv = tomlPackage ? rust-version;
@ -60,6 +60,10 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
type = with types; listOf str; type = with types; listOf str;
default = [ ]; default = [ ];
}; };
extraPaths = mkOption {
type = with types; listOf path;
default = [ ];
};
fileset = mkOption { fileset = mkOption {
type = fileset; type = fileset;
default = fileFilter default = fileFilter