Skip to content

Commit

Permalink
Automtaically add ipv6 entries to nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandapip1 committed Jan 17, 2025
1 parent 1b19054 commit 39d72a5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
});
in
{
nixosModule = { config, ... }:
nixosModule = { config, pkgs, ... }:
with nixpkgs.lib;
let
cfg = config.networking.stevenBlackHosts;
Expand All @@ -29,9 +29,10 @@
};
config = mkIf cfg.enable {
networking.extraHosts =
builtins.readFile (
"${self}/" + (if alternatesList != [] then alternatesPath else "") + "hosts"
);
let
orig = builtins.readFile ("${self}/" + (if alternatesList != [] then alternatesPath else "") + "hosts");
ipv6 = builtins.replaceStrings [ "0.0.0.0" ] [ "::" ] orig;
in orig + "\n" + ipv6;
};
};

Expand Down

0 comments on commit 39d72a5

Please sign in to comment.