move the network config into a module

This commit is contained in:
Andreas Zweili 2022-01-15 15:32:27 +01:00
parent 65fca83f81
commit 2bf232598d
3 changed files with 5 additions and 17 deletions

View File

@ -99,7 +99,8 @@
./modules/desktop
];
nixos-test-vm = mkComputer
./systems/proxmox-vm
(mkVM
{ hostname = "nixos-test-vm"; ip = "10.7.89.235"; })
./home-manager/headless.nix
[
./modules/code-server

View File

@ -1,5 +1,8 @@
{ hostname, ip, ... }:
{
imports = [
(import ../../modules/mk-network { inherit hostname ip; })
];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
@ -21,22 +24,6 @@
fsType = "vfat";
};
networking = {
hostName = hostname;
hosts = {
"127.0.0.1" = [ "${hostname}.2li.local" ];
ip = [ "${hostname}.2li.local" ];
};
defaultGateway = "10.7.89.1";
nameservers = [ "10.7.89.2" ];
interfaces.ens18.ipv4.addresses = [
{
address = ip;
prefixLength = 24;
}
];
};
swapDevices = [
{ device = "/dev/disk/by-label/swap"; }
];