Commit Graph

11 Commits

Author SHA1 Message Date
Bobbe
0303516fa0 Add nixfmt to nix devShell, reformat flake.nix, Ignore flake.lock 2026-04-28 16:04:13 +02:00
Yethal
44d7516aeb Add unbound config nix package 2026-04-27 14:11:42 +02:00
·𐑑𐑴𐑕𐑑𐑩𐑤
1960e05c52 nix flake: use `lib.mkAfter` put the host list at the end
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
2026-02-26 11:44:50 +07:00
Hannes
0d24f15143 Add missing lib to Nix flake 2026-02-25 19:55:58 +08:00
Steven Black
9d408efd1f Merge pull request #2813 from toastal/nix-flake-avoid-with-lib
nix flake refactor: avoid `with lib;` & use `lib.optional*`
2026-02-24 11:43:56 -05:00
Gavin John
5424279ae0 Add defaultText to options.networking.stevenBlackHosts.enableIPv6
Fixes https://github.com/StevenBlack/hosts/issues/2828
2025-03-27 11:25:44 -07:00
โทสฺตัล
0a64bfb3c7 nix flake refactor: avoid `with lib; & use lib.optional*`
Upstream Nixpkgs has been pushing the style of removing ``with lib;``
with the reasoning of clarity around where variables in scope come that
hurt readability & static analysis[*].

While on the topic of ``lib``, introduce ``lib.optional`` &
``lib.optionalString`` in a few more places to tidy up the code while
using common library patterns.

.. [*] https://nix.dev/guides/best-practices#with-scopes

Format: text/x-rst
2025-02-01 19:09:51 +07:00
Gavin John
e457be3a9c Fix mkEnableOption semantics 2025-01-20 15:31:11 -08:00
Gavin John
1f2c2afc3c Automtaically add ipv6 entries to nix flake 2025-01-20 15:31:10 -08:00
toastal
34ba3638fb flake: rm flake-utils dependency
Pulling in an entire dependency to call a for-loop is wasteful & largely
useless.

When user adds this module to their config, flake-utils & all of its
subdependencies will be pulled into the user’s flake.lock file. This
for-loop was only being used for the developer shell to which a lot of
folks probably aren’t doing active developments in this project as the
module itself doesn’t require it. Potentially damagingly is that this
project lacks its own flake.lock so the latest flake-utils will always
be downloaded regardless of if it that version is compatible or not.
Additionally, flake-utils’ default system list doesn’t include
i686-linux which upstream Python3 in Nixpkgs does.

The alternative solution to these problems is to remove the dependency
& just write a for-loop in this project. This solution could be more or
less robust, but it is an extensible version of that loop that could
handle overlays or config changes if needed in the future.
2023-08-29 11:06:48 +07:00
Denis Lehmann
3185c957a5 Add Nix Flake 2021-10-05 13:05:26 +02:00