switch to networkd

This commit is contained in:
Daniel Olsen 2023-03-03 22:28:26 +01:00
parent af955c88f8
commit 6cf831a347
6 changed files with 41 additions and 74 deletions

View File

@ -5,13 +5,15 @@
./users ./users
]; ];
networking.domain = "pvv.ntnu.no"; # networking.domain = "pvv.ntnu.no";
networking.useDHCP = false; # networking.useDHCP = false;
networking.search = [ "pvv.ntnu.no" "pvv.org" ]; # networking.search = [ "pvv.ntnu.no" "pvv.org" ];
networking.nameservers = lib.mkDefault [ "129.241.0.200" "129.241.0.201" ]; # networking.nameservers = lib.mkDefault [ "129.241.0.200" "129.241.0.201" ];
networking.tempAddresses = lib.mkDefault "disabled"; # networking.tempAddresses = lib.mkDefault "disabled";
networking.defaultGateway = values.hosts.gateway; # networking.defaultGateway = values.hosts.gateway;
systemd.network.enable = true;
services.resolved = { services.resolved = {
enable = lib.mkDefault true; enable = lib.mkDefault true;
dnssec = "false"; # Supposdly this keeps breaking and the default is to allow downgrades anyways... dnssec = "false"; # Supposdly this keeps breaking and the default is to allow downgrades anyways...

View File

@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1674198693, "lastModified": 1676674799,
"narHash": "sha256-xjIJ4LinPNbV+0UYwhCldWUiL1e/B+hN4SR8cxOvxZA=", "narHash": "sha256-NaZWOgNrco5OT0J5VrWg02SCkKz8RV1sxRjh0/MWMEc=",
"owner": "dali99", "owner": "dali99",
"repo": "nixos-matrix-modules", "repo": "nixos-matrix-modules",
"rev": "07e95170e8887b918c288c9751e46d3e0b6ab34f", "rev": "362496f4aacb680406db3fad36f98d38e8285b30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1676238723, "lastModified": 1677779205,
"narHash": "sha256-081ya+i6yuVJLDH5UeYcz+5BHKA3IKQw7pk7aqkpLQw=", "narHash": "sha256-6DBjL9wjq86p2GczmwnHtFRnWPBPItc67gapWENBgX8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "38b81240fc7b2edad94951993f1e4f9f5cedb563", "rev": "96e18717904dfedcd884541e5a92bf9ff632cf39",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -51,11 +51,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1676162277, "lastModified": 1677560965,
"narHash": "sha256-GK3cnvKNo1l0skGYXXiLJ/TLqdKyIYXd7jOlo0gN+Qw=", "narHash": "sha256-Tqwt5alTtMnbYUPKCYRYZqlfbjprLgDWqjMhXpFMQ6k=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d863ca850a06d91365c01620dcac342574ecf46f", "rev": "40968a3aa489191cf4b7ba85cf2a54d8a75c8daa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -81,11 +81,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1676171095, "lastModified": 1677833841,
"narHash": "sha256-2laeSjBAAJ9e/C3uTIPb287iX8qeVLtWiilw1uxqG+A=", "narHash": "sha256-yHZFGe7dhBE43FFWKiWc29NuveH+nfyTT6oKyFDEMys=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c5dab21d8706afc7ceb05c23d4244dcb48d6aade", "rev": "128e9b29ddd88ceb634a28f7dbbfee7b895f005f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -96,11 +96,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1676243402, "lastModified": 1677845674,
"narHash": "sha256-BLVAH4iXKlWr7tLG6f+amAaMHPA55xWpJTS4MdBLRf0=", "narHash": "sha256-9wy/QFibdJUp7WQUe50U5bZKocg3OOHBpJhpl5ddfbE=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "14b15a92dcd28a5eea0122f03b31f7f17e816420", "rev": "dcc47fef8bd1e91baeab8fb34a35337ab8f3a3fd",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -22,18 +22,9 @@
networking.hostName = "bekkalokk"; networking.hostName = "bekkalokk";
networking.interfaces.ens33 = { systemd.network.networks."30-ens33" = values.defaultNetworkConfig // {
useDHCP = false; matchConfig.Name = "ens33";
address = with values.hosts.ildkule; [ (ipv4 + "/25") (ipv6 + "/64") ];
ipv4.addresses = [{
address = values.hosts.bekkalokk.ipv4;
prefixLength = 25;
}];
ipv6.addresses = [{
address = values.hosts.bekkalokk.ipv6;
prefixLength = 64;
}];
}; };
# Do not change, even during upgrades. # Do not change, even during upgrades.

View File

@ -20,23 +20,9 @@
networking.hostName = "ildkule"; # Define your hostname. networking.hostName = "ildkule"; # Define your hostname.
networking.interfaces.ens18.useDHCP = false; systemd.network.networks."30-ens18" = values.defaultNetworkConfig // {
matchConfig.Name = "ens18";
networking.interfaces.ens18.ipv4 = { address = with values.hosts.ildkule; [ (ipv4 + "/25") (ipv6 + "/64") ];
addresses = [
{
address = values.hosts.ildkule.ipv4;
prefixLength = 25;
}
];
};
networking.interfaces.ens18.ipv6 = {
addresses = [
{
address = values.hosts.ildkule.ipv6;
prefixLength = 64;
}
];
}; };
# List packages installed in system profile # List packages installed in system profile

View File

@ -22,30 +22,9 @@
services.resolved.enable = false; services.resolved.enable = false;
networking.interfaces.ens10f1.useDHCP = false; systemd.network.networks."30-ens10f1" = values.defaultNetworkConfig // {
networking.interfaces.ens10f1.ipv4 = { matchConfig.Name = "ens10f1";
addresses = [ address = with values.hosts.jokum; [ (ipv4 + "/25") (ipv6 + "/64") ];
{
address = values.hosts.jokum.ipv4;
prefixLength = 25;
}
{
address = values.services.turn.ipv4;
prefixLength = 25;
}
];
};
networking.interfaces.ens10f1.ipv6 = {
addresses = [
{
address = values.hosts.jokum.ipv6;
prefixLength = 64;
}
{
address = values.services.turn.ipv6;
prefixLength = 64;
}
];
}; };
# List packages installed in system profile # List packages installed in system profile

View File

@ -34,4 +34,13 @@ in rec {
ipv6 = pvv-ipv6 209; ipv6 = pvv-ipv6 209;
}; };
}; };
defaultNetworkConfig = {
networkConfig.IPv6AcceptRA = "no";
gateway = [ hosts.gateway ];
dns = [ "129.241.0.200" "129.241.0.201" ];
domains = [ "pvv.ntnu.no" "pvv.org" ];
DHCP = "no";
};
} }