fix(network): split network config to avoid inf recursion

This commit is contained in:
winston 2023-03-01 20:47:27 +01:00
parent c95299669c
commit 78df3dc15b
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 45 additions and 57 deletions

View file

@ -2,14 +2,9 @@
lib,
pkgs,
...
}: let
inherit (pkgs.stdenv.hostPlatform) isLinux;
in {
services =
{
dnsmasq =
if isLinux
then {
}: {
services = {
dnsmasq = {
enable = true;
servers = [
"::1#53000"
@ -24,17 +19,7 @@ in {
# loopback for development
address=/test/127.0.0.1
'';
}
# nix-darwin config
else {
enable = true;
addresses."test" = "127.0.0.1";
bind = "127.0.0.1";
};
}
// (
if isLinux
then {
mullvad-vpn = {
enable = true;
};
@ -57,7 +42,5 @@ in {
];
};
};
}
else {}
);
};
}

View file

@ -29,5 +29,10 @@
services = {
# Auto upgrade nix package and the daemon service.
nix-daemon.enable = true;
dnsmasq = {
enable = true;
addresses."test" = "127.0.0.1";
bind = "127.0.0.1";
};
};
}