aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-02-18 14:36:30 +0100
committerGitHub <noreply@github.com>2020-02-18 14:36:30 +0100
commited9fc6658226b1525bc008205d76276f0054c6c5 (patch)
tree1047d711c21c7cf5c0c5026f2159ad0453fc2a0b /lib
parent8161ec736759a7f21d9d6ec6e5ff8189df9ebbe7 (diff)
parent56d4dc28b325503c8b0261e2c12bdbaecc6903b9 (diff)
Merge pull request #15 from nyantec/feature/filtersv1.20.0
support for include filters
Diffstat (limited to 'lib')
-rw-r--r--lib/types/populate.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/types/populate.nix b/lib/types/populate.nix
index e23ddb0..0427dbd 100644
--- a/lib/types/populate.nix
+++ b/lib/types/populate.nix
@@ -54,6 +54,18 @@
};
});
+ filter = lib.types.submodule {
+ options = {
+ type = lib.mkOption {
+ type = lib.types.enum ["include" "exclude"];
+ default = "exclude";
+ };
+ pattern = lib.mkOption {
+ type = lib.types.str;
+ };
+ };
+ };
+
source-types = {
derivation = lib.types.submodule {
options = {
@@ -76,6 +88,28 @@
default = [];
example = [".git"];
};
+ filters = lib.mkOption {
+ type = lib.types.listOf filter;
+ default = [];
+ example = [
+ {
+ type = "include";
+ pattern = "*.nix";
+ }
+ {
+ type = "include";
+ pattern = "*/";
+ }
+ {
+ type = "exclude";
+ pattern = "*";
+ }
+ ];
+ };
+ deleteExcluded = lib.mkOption {
+ default = true;
+ type = lib.types.bool;
+ };
};
};
git = lib.types.submodule {