diff options
| author | Milan Pässler <me@pbb.lc> | 2020-02-03 16:37:55 +0100 | 
|---|---|---|
| committer | Milan Pässler <me@pbb.lc> | 2020-02-03 16:37:55 +0100 | 
| commit | 56d4dc28b325503c8b0261e2c12bdbaecc6903b9 (patch) | |
| tree | 377f25c1c987d40f85e466e3f20be40aaaf2aa42 /lib | |
| parent | f1b7112ac3cbe090e96f2c82c525b6db69b82034 (diff) | |
support for include filters
- Added a new option for `file` sources, which allows to specify a list
  of `include` and `exclude` filters
- Added a new option for `file` sources, which allows to disable the
  `--delete-excluded` behaviour.
Diffstat (limited to 'lib')
| -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 { | 
