mirror of
https://codeberg.org/icewind/mill-scale.git
synced 2026-06-03 09:54:19 +02:00
add extraFilesRegex option
This commit is contained in:
parent
08e5974348
commit
a195211af0
1 changed files with 9 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
{ lib, src, config, flakelight, inputs, ... }:
|
||||
let
|
||||
inherit (builtins) elem readFile pathExists isAttrs attrNames;
|
||||
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.fileset) fileFilter toSource;
|
||||
inherit (flakelight.types) fileset function;
|
||||
|
|
@ -56,10 +56,17 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
|||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
extraFilesRegex = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
};
|
||||
fileset = mkOption {
|
||||
type = fileset;
|
||||
default = fileFilter
|
||||
(file: file.hasExt "rs" || elem file.name ([ "Cargo.toml" "Cargo.lock" ] ++ config.extraFiles))
|
||||
(file:
|
||||
file.hasExt "rs" ||
|
||||
elem file.name ([ "Cargo.toml" "Cargo.lock" ] ++ config.extraFiles) ||
|
||||
any (re: match re file.name != null) config.extraFilesRegex)
|
||||
src;
|
||||
};
|
||||
crossTargets = mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue