Skip to content

nix flake: use lib.mkAfter put the host list at the end #2814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toastal
Copy link
Contributor

@toastal toastal commented Jan 30, 2025

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:

{
  networking = {
    stevenBlockHosts.enable = true;
    extraHosts = ''
      127.0.0.1 myproject.localhost
    '';
  };
}

will now output

127.0.0.1 localhost
::1 localhost

127.0.0.1 myproject.localhost

# Title: StevenBlack/hosts with the fakenews extension
#
# …

NOTE: using lib.* like #2813 to avoid a potential merge conflict


Also has been open @ https://gitlab.com/StevenBlack/hosts/-/merge_requests/3

@toastal toastal force-pushed the nix-mkafter branch 2 times, most recently from db1d052 to dd05205 Compare February 22, 2025 14:42
@toastal toastal force-pushed the nix-mkafter branch 2 times, most recently from 8888ec1 to b2d5175 Compare March 9, 2025 03:33
@toastal toastal changed the title nix flake: use lib.mkAfter to allow extraHosts nix flake: use lib.mkAfter put the host list at the end Mar 11, 2025
@toastal toastal force-pushed the nix-mkafter branch 2 times, most recently from dbb555e to 2e56bfe Compare April 4, 2025 12:50
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant