diff options
author | tv <tv@krebsco.de> | 2020-02-18 14:36:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-18 14:36:30 +0100 |
commit | ed9fc6658226b1525bc008205d76276f0054c6c5 (patch) | |
tree | 1047d711c21c7cf5c0c5026f2159ad0453fc2a0b /lib/types | |
parent | 8161ec736759a7f21d9d6ec6e5ff8189df9ebbe7 (diff) | |
parent | 56d4dc28b325503c8b0261e2c12bdbaecc6903b9 (diff) |
Merge pull request #15 from nyantec/feature/filters
support for include filters
Diffstat (limited to 'lib/types')
-rw-r--r-- | lib/types/populate.nix | 34 |
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 { |