core-services-01: Switch to systemd-network
This commit is contained in:
parent
5138eb930f
commit
f410aa4c75
3 changed files with 70 additions and 51 deletions
|
@ -1,31 +1,34 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./nur.nix
|
||||
./rz.nix
|
||||
./monitoring.nix
|
||||
./programs.nix
|
||||
./system.nix
|
||||
./acme-ssl.nix
|
||||
./dns.nix
|
||||
./netboot-server.nix
|
||||
./qemu.nix
|
||||
./gitea.nix
|
||||
./dokuwiki.nix
|
||||
./nginx.nix
|
||||
./keycloak.nix
|
||||
|
||||
./acme-dns.nix
|
||||
./acme-ssl.nix
|
||||
./backups.nix
|
||||
./headscale.nix
|
||||
./snipe-it.nix
|
||||
# ./dex.nix
|
||||
./oauth2_proxy.nix
|
||||
./secrets
|
||||
./dns.nix
|
||||
./dokuwiki.nix
|
||||
./gitea.nix
|
||||
./headscale.nix
|
||||
./keycloak.nix
|
||||
./matterbridge.nix
|
||||
./monitoring.nix
|
||||
./netboot-server.nix
|
||||
./network.nix
|
||||
./nginx.nix
|
||||
./nur.nix
|
||||
./oauth2_proxy.nix
|
||||
./programs.nix
|
||||
./qemu.nix
|
||||
./rz.nix
|
||||
./secrets
|
||||
./snipe-it.nix
|
||||
./system.nix
|
||||
./tunnels.nix
|
||||
|
||||
# TODO push to gitea
|
||||
# TODO ./gotify.nix
|
||||
# TODO(Raito): ./backups.nix
|
||||
|
|
|
@ -99,24 +99,4 @@ in
|
|||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
36
machines/core-services-01/network.nix
Normal file
36
machines/core-services-01/network.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue