nixos/modules: use mapAttrsToList instead of mapAttrsFlatten
This commit is contained in:
parent
a13e0a12b7
commit
7919709a23
@ -10,7 +10,7 @@ let
|
|||||||
cfg = config.programs.bash;
|
cfg = config.programs.bash;
|
||||||
|
|
||||||
bashAliases = builtins.concatStringsSep "\n" (
|
bashAliases = builtins.concatStringsSep "\n" (
|
||||||
lib.mapAttrsFlatten (k: v: "alias -- ${k}=${lib.escapeShellArg v}")
|
lib.mapAttrsToList (k: v: "alias -- ${k}=${lib.escapeShellArg v}")
|
||||||
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@ let
|
|||||||
cfg = config.programs.fish;
|
cfg = config.programs.fish;
|
||||||
|
|
||||||
fishAbbrs = lib.concatStringsSep "\n" (
|
fishAbbrs = lib.concatStringsSep "\n" (
|
||||||
lib.mapAttrsFlatten (k: v: "abbr -ag ${k} ${lib.escapeShellArg v}")
|
lib.mapAttrsToList (k: v: "abbr -ag ${k} ${lib.escapeShellArg v}")
|
||||||
cfg.shellAbbrs
|
cfg.shellAbbrs
|
||||||
);
|
);
|
||||||
|
|
||||||
fishAliases = lib.concatStringsSep "\n" (
|
fishAliases = lib.concatStringsSep "\n" (
|
||||||
lib.mapAttrsFlatten (k: v: "alias ${k} ${lib.escapeShellArg v}")
|
lib.mapAttrsToList (k: v: "alias ${k} ${lib.escapeShellArg v}")
|
||||||
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ let
|
|||||||
opt = options.programs.zsh;
|
opt = options.programs.zsh;
|
||||||
|
|
||||||
zshAliases = builtins.concatStringsSep "\n" (
|
zshAliases = builtins.concatStringsSep "\n" (
|
||||||
lib.mapAttrsFlatten (k: v: "alias -- ${k}=${lib.escapeShellArg v}")
|
lib.mapAttrsToList (k: v: "alias -- ${k}=${lib.escapeShellArg v}")
|
||||||
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
(lib.filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ in
|
|||||||
|
|
||||||
config = mkIf (cfg.servers != { }) {
|
config = mkIf (cfg.servers != { }) {
|
||||||
|
|
||||||
systemd.services = (listToAttrs (mapAttrsFlatten (name: value: nameValuePair "openvpn-${name}" (makeOpenVPNJob value name)) cfg.servers))
|
systemd.services = (listToAttrs (mapAttrsToList (name: value: nameValuePair "openvpn-${name}" (makeOpenVPNJob value name)) cfg.servers))
|
||||||
// restartService;
|
// restartService;
|
||||||
|
|
||||||
environment.systemPackages = [ openvpn ];
|
environment.systemPackages = [ openvpn ];
|
||||||
|
Loading…
Reference in New Issue
Block a user