From 5164fefbc09fd9830a3244ff75ce3fbd94896bd6 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Wed, 26 Jul 2023 22:52:25 +0300 Subject: [PATCH] Format networking.nix --- modules/environment/networking.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/environment/networking.nix b/modules/environment/networking.nix index 860c8c8f..1c16b0f3 100644 --- a/modules/environment/networking.nix +++ b/modules/environment/networking.nix @@ -70,18 +70,21 @@ in ''; }]; - networking.hostFiles = let - localhostHosts = pkgs.writeText "localhost-hosts" '' - 127.0.0.1 localhost - ::1 localhost - ''; - stringHosts = - let - oneToString = set: ip: ip + " " + concatStringsSep " " set.${ip} + "\n"; - allToString = set: concatMapStrings (oneToString set) (attrNames set); - in pkgs.writeText "string-hosts" (allToString (filterAttrs (_: v: v != []) cfg.hosts)); - extraHosts = pkgs.writeText "extra-hosts" cfg.extraHosts; - in mkBefore [ localhostHosts stringHosts extraHosts ]; + networking.hostFiles = + let + localhostHosts = pkgs.writeText "localhost-hosts" '' + 127.0.0.1 localhost + ::1 localhost + ''; + stringHosts = + let + oneToString = set: ip: ip + " " + concatStringsSep " " set.${ip} + "\n"; + allToString = set: concatMapStrings (oneToString set) (attrNames set); + in + pkgs.writeText "string-hosts" (allToString (filterAttrs (_: v: v != [ ]) cfg.hosts)); + extraHosts = pkgs.writeText "extra-hosts" cfg.extraHosts; + in + mkBefore [ localhostHosts stringHosts extraHosts ]; environment.etc = { # /etc/services: TCP/UDP port assignments.