moved metal-specific configuration to its own file
This commit is contained in:
parent
3fcde8ba62
commit
5a279d1106
|
@ -14,7 +14,7 @@
|
|||
./modules/nix-settings.nix
|
||||
./modules/zfs.nix
|
||||
|
||||
(import ./modules/networking.nix {hostname = "server";})
|
||||
(import ./modules/networking-shared.nix {hostname = "server";})
|
||||
(import ./modules/users.nix {main-user = "baritone";})
|
||||
];
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
inputs.home-manager.nixosModules.default
|
||||
inputs.simple-nixos-mailserver.nixosModule
|
||||
inputs.microvm.nixosModules.microvm
|
||||
{microvm.hyprvisor = "qemu";}
|
||||
{microvm.hypervisor = "qemu";}
|
||||
];
|
||||
in {
|
||||
server-vm = nixpkgs.lib.nixosSystem {
|
||||
|
@ -91,6 +91,7 @@
|
|||
];
|
||||
})
|
||||
|
||||
./modules/networking-metal.nix
|
||||
./hardware-configuration.nix
|
||||
./configuration.nix
|
||||
]
|
||||
|
|
27
modules/networking-metal.nix
Normal file
27
modules/networking-metal.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{...}:
|
||||
{
|
||||
networking.useDHCP = false;
|
||||
|
||||
networking.wakeOnLan.enable = true;
|
||||
networking.enp2s0.wakeOnLan.policy = "magic";
|
||||
|
||||
networking.interfaces.enp2s0 = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.0.101.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
networking.defaultGateway = {
|
||||
address = "10.0.101.1";
|
||||
interface = "enp2s0";
|
||||
};
|
||||
|
||||
networking.nameservers = [
|
||||
"10.0.101.1"
|
||||
"8.8.8.8"
|
||||
"8.8.4.4"
|
||||
];
|
||||
}
|
10
modules/networking-shared.nix
Executable file
10
modules/networking-shared.nix
Executable file
|
@ -0,0 +1,10 @@
|
|||
{hostname ? "server"}: {...}: {
|
||||
networking.hostName = hostname;
|
||||
networking.hostId = "2ead098f";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [];
|
||||
allowedUDPPorts = [];
|
||||
};
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
{hostname ? "server"}: {...}: {
|
||||
networking.hostName = hostname;
|
||||
networking.hostId = "2ead098f";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.useDHCP = false;
|
||||
# networking.resolvconf.dnsExtensionMechanism = false;
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [];
|
||||
allowedUDPPorts = [];
|
||||
};
|
||||
|
||||
networking.wakeOnLan.enable = true;
|
||||
networking.enp2s0.wakeOnLan.policy = "magic";
|
||||
|
||||
networking.interfaces.enp2s0 = {
|
||||
ipv4.addresses = [
|
||||
{
|
||||
address = "10.0.101.10";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
networking.defaultGateway = {
|
||||
address = "10.0.101.1";
|
||||
interface = "enp2s0";
|
||||
};
|
||||
|
||||
networking.nameservers = [
|
||||
"10.0.101.1"
|
||||
"8.8.8.8"
|
||||
"8.8.4.4"
|
||||
];
|
||||
|
||||
# Uncomment when domain is set up
|
||||
# security.acme = {
|
||||
# acceptTerms = true;
|
||||
# certs = {
|
||||
# defaults.email = "admin@spoodythe.one";
|
||||
# };
|
||||
# };
|
||||
}
|
Loading…
Reference in a new issue