Skip to content

Commit cf34678

Browse files
committed
Automtaically add ipv6 entries to nix flake
1 parent 1b19054 commit cf34678

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

flake.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
};
3030
config = mkIf cfg.enable {
3131
networking.extraHosts =
32-
builtins.readFile (
33-
"${self}/" + (if alternatesList != [] then alternatesPath else "") + "hosts"
34-
);
32+
let
33+
orig = builtins.readFile ("${self}/" + (if alternatesList != [] then alternatesPath else "") + "hosts");
34+
ipv6 = builtins.replaceStrings [ "0.0.0.0" ] [ "::" ] orig;
35+
in orig + "\n" + ipv6;
3536
};
3637
};
3738

0 commit comments

Comments
 (0)