mirror of
https://codeberg.org/icewind/galton.git
synced 2026-06-03 18:34:08 +02:00
add remove-duplicates option
This commit is contained in:
parent
1781b20f20
commit
6705debd2a
8 changed files with 308 additions and 30 deletions
|
|
@ -9,7 +9,10 @@ with lib; let
|
|||
format = pkgs.formats.toml {};
|
||||
removeNulls = filterAttrs (_: val: val != null);
|
||||
configFile = format.generate "galton.toml" {
|
||||
watch = removeNulls {inherit (cfg) symlink;};
|
||||
watch = removeNulls {
|
||||
inherit (cfg) symlink;
|
||||
remove-duplicates = cfg.removeDuplicates;
|
||||
};
|
||||
rule = map removeNulls cfg.rules;
|
||||
};
|
||||
in {
|
||||
|
|
@ -28,6 +31,12 @@ in {
|
|||
description = "Create a symlink to matched files";
|
||||
};
|
||||
|
||||
removeDuplicates = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Remove duplicate downloads";
|
||||
};
|
||||
|
||||
rules = mkOption {
|
||||
default = [];
|
||||
type = types.listOf (types.submodule {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue