core-services-01: Switch to systemd-network

This commit is contained in:
Tom Hubrecht 2023-01-25 15:35:41 +01:00
parent 5138eb930f
commit f410aa4c75
3 changed files with 70 additions and 51 deletions

View file

@ -1,37 +1,40 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports = imports = [
[ # Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./nur.nix
./rz.nix ./acme-dns.nix
./monitoring.nix ./acme-ssl.nix
./programs.nix ./backups.nix
./system.nix # ./dex.nix
./acme-ssl.nix ./dns.nix
./dns.nix ./dokuwiki.nix
./netboot-server.nix ./gitea.nix
./qemu.nix ./headscale.nix
./gitea.nix ./keycloak.nix
./dokuwiki.nix ./matterbridge.nix
./nginx.nix ./monitoring.nix
./keycloak.nix ./netboot-server.nix
./acme-dns.nix ./network.nix
./backups.nix ./nginx.nix
./headscale.nix ./nur.nix
./snipe-it.nix ./oauth2_proxy.nix
# ./dex.nix ./programs.nix
./oauth2_proxy.nix ./qemu.nix
./secrets ./rz.nix
./matterbridge.nix ./secrets
./tunnels.nix ./snipe-it.nix
# TODO push to gitea ./system.nix
# TODO ./gotify.nix ./tunnels.nix
# TODO(Raito): ./backups.nix
# TODO(Raito): ./snmp.nix # TODO push to gitea
# TODO(Raito): ./sflow.nix? # TODO ./gotify.nix
]; # TODO(Raito): ./backups.nix
# TODO(Raito): ./snmp.nix
# TODO(Raito): ./sflow.nix?
];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View file

@ -99,24 +99,4 @@ in
example = [ "10.1.0.0/22" ]; example = [ "10.1.0.0/22" ];
}; };
}; };
config = {
# Default IPv4 exit route
networking.defaultGateway = {
address = "";
interface = "ens18";
};
networking.interfaces.ens20 = {
ipv4.addresses = map mkAddress cfg.ipv4InternalFull;
};
networking.interfaces.ens19 = {
ipv6.addresses = map mkAddress (cfg.ipv6.standardFull ++ [ cfg.ipv6.acmeFull ]);
};
networking.interfaces.ens18 = {
ipv4.addresses = map mkAddress cfg.ipv4Full;
};
};
} }

View file

@ -0,0 +1,36 @@
{ config, ... }:
let
inherit (config) my;
in
{
networking.useNetworkd = true;
systemd.network.networks = {
"10-ens18" = {
name = "ens18";
address = my.ipv4Full;
DHCP = "ipv4";
};
"10-ens19" = {
name = "ens19";
address = with my.ipv6; standardFull ++ [ acmeFull ];
networkConfig.IPv6AcceptRA = true;
ipv6AcceptRAConfig = {
UseOnLinkPrefix = false;
UseAutonomousPrefix = false;
};
};
"10-ens20" = {
name = "ens20";
address = my.ipv4InternalFull;
DHCP = "ipv4";
};
};
}