From 1960e05c52b04e43a96d7bbdd195be8d04931983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B7=F0=90=91=91=F0=90=91=B4=F0=90=91=95=F0=90=91=91?= =?UTF-8?q?=F0=90=91=A9=F0=90=91=A4?= Date: Thu, 26 Feb 2026 11:44:50 +0700 Subject: [PATCH] nix flake: use ``lib.mkAfter`` put the host list at the end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At present, if a user uses ``networking.stevenBlockHosts.enable = true`` in tandem with ``networking.extraHosts``, the ``extraHosts`` will put be put after which makes it very difficult to see the custom adds with even the ``$PAGER`` operating a bit slow due to file size. I would propose putting this project’s hosts at the end of the hosts file. Meaning: .. code:: nix { networking = { stevenBlockHosts.enable = true; extraHosts = '' 127.0.0.1 myproject.localhost ''; }; } will now output .. code:: 127.0.0.1 localhost ::1 localhost 127.0.0.1 myproject.localhost # Title: StevenBlack/hosts with the fakenews extension # # … Format: text/x-rst --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 2f9f07190..27abbe1f3 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ orig = builtins.readFile ("${self}/" + (lib.optionalString (alternatesList != []) alternatesPath) + "hosts"); ipv6 = builtins.replaceStrings [ "0.0.0.0" ] [ "::" ] orig; in - orig + (lib.optionalString cfg.enableIPv6 ("\n" + ipv6)); + lib.mkAfter (orig + (lib.optionalString cfg.enableIPv6 ("\n" + ipv6))); }; };