Commit 7919709a authored by Ivan Trubach's avatar Ivan Trubach
Browse files

nixos/modules: use mapAttrsToList instead of mapAttrsFlatten

parent a13e0a12
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ let
  cfg = config.programs.bash;

  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)
  );

+2 −2
Original line number Diff line number Diff line
@@ -7,12 +7,12 @@ let
  cfg = config.programs.fish;

  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
  );

  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)
  );

+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ let
  opt = options.programs.zsh;

  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)
  );

+1 −1
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ in

  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;

    environment.systemPackages = [ openvpn ];