mirror of
https://codeberg.org/icewind/mill-scale.git
synced 2026-06-03 18:04:09 +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, ... }:
|
{ lib, src, config, flakelight, inputs, ... }:
|
||||||
let
|
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) 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;
|
||||||
inherit (flakelight.types) fileset function;
|
inherit (flakelight.types) fileset function;
|
||||||
|
|
@ -56,10 +56,17 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
type = with types; listOf str;
|
type = with types; listOf str;
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
extraFilesRegex = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
fileset = mkOption {
|
fileset = mkOption {
|
||||||
type = fileset;
|
type = fileset;
|
||||||
default = fileFilter
|
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;
|
src;
|
||||||
};
|
};
|
||||||
crossTargets = mkOption {
|
crossTargets = mkOption {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue