summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Werling <lukas@lwrl.de>2024-07-16 23:38:14 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2024-07-17 21:46:23 +0000
commit1fac62a83323f63c925bf91cad76e9fe3d0ac2cb (patch)
treeb49150e98a778d959fcbca178b58eacec4c3bf73
parentMerge pull request #327880 from NixOS/backport-325434-to-release-24.05 (diff)
downloadnixpkgs-origin/backport-327748-to-release-24.05.tar.gz
nixos/tsm-client: Fix multi-value dsm.sys optionsorigin/backport-327748-to-release-24.05
A configuration such as: programs.tsmClient.servers.backup.domain = [ "/dir1" "dir2" ]; ...would previously result in an error ("cannot coerce a list to a string"), since `makeDsmSysLines` would return a nested list. (cherry picked from commit f52ee2af3928fbbf02dd7eb368e821ea9d65fb5f)
-rw-r--r--nixos/modules/programs/tsm-client.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/programs/tsm-client.nix b/nixos/modules/programs/tsm-client.nix
index 82fbc9b26e2d..6f70738ec3c8 100644
--- a/nixos/modules/programs/tsm-client.nix
+++ b/nixos/modules/programs/tsm-client.nix
@@ -4,7 +4,7 @@ let optionsGlobal = options; in
let
inherit (lib.attrsets) attrNames attrValues mapAttrsToList removeAttrs;
- inherit (lib.lists) all allUnique concatLists elem isList map;
+ inherit (lib.lists) all allUnique concatLists concatMap elem isList map;
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) mkEnableOption mkOption mkPackageOption;
inherit (lib.strings) concatLines match optionalString toLower;
@@ -231,7 +231,7 @@ let
# Turn a key-value pair from the server options attrset
# into zero (value==null), one (scalar value) or
# more (value is list) configuration stanza lines.
- if isList value then map (makeDsmSysLines key) value else # recurse into list
+ if isList value then concatMap (makeDsmSysLines key) value else # recurse into list
if value == null then [ ] else # skip `null` value
[ (" ${key}${
if value == true then "" else # just output key if value is `true`