summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorValentin Shirokov <regellosigkeitsaxiom@yandex.ru>2017-07-09 08:56:36 +0300
committerValentin Shirokov <regellosigkeitsaxiom@yandex.ru>2017-07-09 08:56:36 +0300
commit163393865fd4828842f956d603c1c83fe6ab08b2 (patch)
treeb110389bd6c47486b08801c53eaa196cb4ccfc9b /nixos/modules/config
parent2f9799399255bdacc028092b904f6ea0afc7a09a (diff)
downloadnixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar.gz
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar.bz2
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar.lz
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar.xz
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.tar.zst
nixlib-163393865fd4828842f956d603c1c83fe6ab08b2.zip
Style optimizations
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/networking.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/config/networking.nix b/nixos/modules/config/networking.nix
index 760f8353fb30..6035facb594e 100644
--- a/nixos/modules/config/networking.nix
+++ b/nixos/modules/config/networking.nix
@@ -212,13 +212,13 @@ in
         # /etc/hosts: Hostname-to-IP mappings.
         "hosts".text =
           let oneToString = set : ip : ip + " " + concatStringsSep " " ( getAttr ip set );
-              allToString = set : concatStringsSep "\n" ( map ( oneToString set ) ( builtins.attrNames set ));
+              allToString = set : concatMapStringsSep "\n" ( oneToString set ) ( attrNames set );
               userLocalHosts = optionalString
                 ( builtins.hasAttr "127.0.0.1" cfg.hosts )
-                ( concatStringsSep " " ( filter (x : x != "localhost" ) ( getAttr "127.0.0.1" cfg.hosts)));
+                ( concatStringsSep " " ( remove "localhost" cfg.hosts."127.0.0.1" ));
               userLocalHosts6 = optionalString
                 ( builtins.hasAttr "::1" cfg.hosts )
-                ( concatStringsSep " " ( filter (x : x != "localhost" ) ( getAttr "::1" cfg.hosts)));
+                ( concatStringsSep " " ( remove "localhost" cfg.hosts."::1" ));
               otherHosts = allToString ( removeAttrs cfg.hosts [ "127.0.0.1" "::1" ]);
               maybeFQDN = optionalString ( cfg.fqdn != null ) cfg.fqdn;
           in