diff options
author | Yarny0 <41838844+Yarny0@users.noreply.github.com> | 2021-12-05 13:52:06 +0100 |
---|---|---|
committer | Yarny0 <41838844+Yarny0@users.noreply.github.com> | 2022-01-17 12:09:27 +0100 |
commit | c2192ed77ae517094a235dfb0ef33d7b88d81212 (patch) | |
tree | 1ff2f3b961d276cf49febe441d2031a936947fc9 /nixos | |
parent | c5effcaaeac42e3d54dd04985645ab2600641ad8 (diff) | |
download | nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar.gz nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar.bz2 nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar.lz nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar.xz nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.tar.zst nixlib-c2192ed77ae517094a235dfb0ef33d7b88d81212.zip |
nixos/tsm-{client,backup}: use new type `nonEmptyStr`
The module option type `nonEmptyStr` was introduced in commit https://github.com/NixOS/nixpkgs/commit/a3c5f0cba8fa9c4d9782ef83757be6e4028f54b7 The tsm modules previously simply used `strMatching ".+"` to prevent empty option strings, but the new type is more thorough as it also catches space-only strings.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/tsm-client.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/backup/tsm.nix | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/nixos/modules/programs/tsm-client.nix b/nixos/modules/programs/tsm-client.nix index 421beec86e50..28db96253875 100644 --- a/nixos/modules/programs/tsm-client.nix +++ b/nixos/modules/programs/tsm-client.nix @@ -7,7 +7,7 @@ let inherit (lib.modules) mkDefault mkIf; inherit (lib.options) literalExpression mkEnableOption mkOption; inherit (lib.strings) concatStringsSep optionalString toLower; - inherit (lib.types) addCheck attrsOf lines nullOr package path port str strMatching submodule; + inherit (lib.types) addCheck attrsOf lines nonEmptyStr nullOr package path port str strMatching submodule; # Checks if given list of strings contains unique # elements when compared without considering case. @@ -35,7 +35,7 @@ let ''; }; options.server = mkOption { - type = strMatching ".+"; + type = nonEmptyStr; example = "tsmserver.company.com"; description = '' Host/domain name or IP address of the IBM TSM server. @@ -56,7 +56,7 @@ let ''; }; options.node = mkOption { - type = strMatching ".+"; + type = nonEmptyStr; example = "MY-TSM-NODE"; description = '' Target node name on the IBM TSM server. diff --git a/nixos/modules/services/backup/tsm.nix b/nixos/modules/services/backup/tsm.nix index 0017a6f69c16..4e690ac6ecda 100644 --- a/nixos/modules/services/backup/tsm.nix +++ b/nixos/modules/services/backup/tsm.nix @@ -5,7 +5,7 @@ let inherit (lib.attrsets) hasAttr; inherit (lib.modules) mkDefault mkIf; inherit (lib.options) mkEnableOption mkOption; - inherit (lib.types) nullOr strMatching; + inherit (lib.types) nonEmptyStr nullOr; options.services.tsmBackup = { enable = mkEnableOption '' @@ -15,7 +15,7 @@ let <option>programs.tsmClient.enable</option> ''; command = mkOption { - type = strMatching ".+"; + type = nonEmptyStr; default = "backup"; example = "incr"; description = '' @@ -24,7 +24,7 @@ let ''; }; servername = mkOption { - type = strMatching ".+"; + type = nonEmptyStr; example = "mainTsmServer"; description = '' Create a systemd system service @@ -41,7 +41,7 @@ let ''; }; autoTime = mkOption { - type = nullOr (strMatching ".+"); + type = nullOr nonEmptyStr; default = null; example = "12:00"; description = '' |