aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-03-17 19:32:46 +0100
committertv <tv@krebsco.de>2020-03-17 19:32:46 +0100
commit9c16ab1ce11eb2c16af97e1b293961178a9f1b7b (patch)
tree2fad32efa2be5d7605103a263c676b3ceb261bd5
parented9fc6658226b1525bc008205d76276f0054c6c5 (diff)
populate file: deprecated exclude option
-rw-r--r--README.md17
-rw-r--r--lib/types/populate.nix10
2 files changed, 16 insertions, 11 deletions
diff --git a/README.md b/README.md
index abbfd45..dcc92d4 100644
--- a/README.md
+++ b/README.md
@@ -149,19 +149,14 @@ Supported attributes:
boolean that controls whether file contents should be checked to decide
whether a file has changed. This is useful when `path` points at files
with mangled timestamps, e.g. the Nix store.
-
-* `exclude` (optional)
- List of patterns that should excluded from being synced. The list will be
- passed to the `--exclude` option of [`rsync`](https://rsync.samba.org/).
- Checkout the filter rules section in the [rsync
- manual](https://download.samba.org/pub/rsync/rsync.html) for further
- information.
* `filters` (optional)
- List of filters that should be passed to rsync. Filters are specified as
- attribute sets with the attributes `type` and `pattern`. Supported filter
- types are `include` and `exclude`. This allows for more advanced
- configurations.
+ List of filters that should be passed to [`rsync`](https://rsync.samba.org/).
+ Filters are specified as attribute sets with the attributes `type` and
+ `pattern`. Supported filter types are `include` and `exclude`.
+ Checkout the filter rules section in the
+ [rsync manual](https://download.samba.org/pub/rsync/rsync.html)
+ for further information.
* `deleteExcluded` (optional)
boolean that controls whether the excluded directories should be deleted
diff --git a/lib/types/populate.nix b/lib/types/populate.nix
index 0427dbd..4ac9b1f 100644
--- a/lib/types/populate.nix
+++ b/lib/types/populate.nix
@@ -84,6 +84,16 @@
type = lib.types.bool;
};
exclude = lib.mkOption {
+ apply = x:
+ if x != [] then
+ lib.warn
+ "file.*.exclude is deprecated in favor of file.*.filters"
+ x
+ else
+ x;
+ description = ''
+ DEPRECATED, use `filters`.
+ '';
type = lib.types.listOf lib.types.str;
default = [];
example = [".git"];