diff --git a/machines/albert/configuration.nix b/machines/albert/configuration.nix index fadfae8..817091b 100644 --- a/machines/albert/configuration.nix +++ b/machines/albert/configuration.nix @@ -88,7 +88,6 @@ in nixpkgs.config.allowUnfree = true; services.acpid.enable = true; - networking.networkmanager.enable = true; time.timeZone = "Europe/Berlin"; system.stateVersion = "26.05"; # Do.. Not.. Change.. } diff --git a/machines/bakunin/configuration.nix b/machines/bakunin/configuration.nix index 8e46922..700e047 100644 --- a/machines/bakunin/configuration.nix +++ b/machines/bakunin/configuration.nix @@ -83,7 +83,6 @@ in services.acpid.enable = true; networking.hostName = "bakunin"; - networking.networkmanager.enable = true; security.rtkit.enable = true; services.pipewire = { diff --git a/machines/fanny/configuration.nix b/machines/fanny/configuration.nix index 1ac0b47..6df9d64 100644 --- a/machines/fanny/configuration.nix +++ b/machines/fanny/configuration.nix @@ -332,7 +332,6 @@ in services.acpid.enable = true; networking.hostName = "fanny"; - networking.networkmanager.enable = true; virtualisation.vmVariant.virtualisation.graphics = false; diff --git a/machines/hosts.nix b/machines/hosts.nix index ab3fdc2..5a264b8 100644 --- a/machines/hosts.nix +++ b/machines/hosts.nix @@ -29,6 +29,8 @@ in local = true; hostId = "11"; address = "192.168.1.101"; + gateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" "1.1.1.1" ]; }; }; @@ -38,6 +40,8 @@ in local = true; hostId = "12"; address = "192.168.1.102"; + gateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" "1.1.1.1" ]; }; }; @@ -47,6 +51,8 @@ in local = true; hostId = "13"; address = "192.168.1.103"; + gateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" "1.1.1.1" ]; }; }; @@ -56,6 +62,8 @@ in local = true; hostId = "15"; address = "192.168.1.105"; + gateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" "1.1.1.1" ]; }; }; @@ -65,6 +73,8 @@ in local = true; hostId = "19"; address = "192.168.1.111"; + gateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" "1.1.1.1" ]; }; }; diff --git a/machines/louise/configuration.nix b/machines/louise/configuration.nix index 89d3d50..bc9cf80 100644 --- a/machines/louise/configuration.nix +++ b/machines/louise/configuration.nix @@ -71,7 +71,6 @@ services.acpid.enable = true; networking.hostName = "louise"; - networking.networkmanager.enable = true; security.rtkit.enable = true; services.pipewire = { diff --git a/machines/modules/host_builder.nix b/machines/modules/host_builder.nix index ae15cb2..a748938 100644 --- a/machines/modules/host_builder.nix +++ b/machines/modules/host_builder.nix @@ -45,6 +45,20 @@ rec { ]; defaultModules = baseModules; + makeNetwork = network: [{ + systemd.network.enable = true; + + systemd.network.networks."20-lan" = { + matchConfig.Type = "ether"; + networkConfig = { + Address = [ "${network.address}/24" ]; + Gateway = "${network.gateway}"; + DNS = network.nameservers; + DHCP = "no"; + }; + }; + }]; + makeMicroVM = hostName: network: modules: [ { microvm = { @@ -89,18 +103,6 @@ rec { } ]; }; - - systemd.network.enable = true; - - systemd.network.networks."20-lan" = { - matchConfig.Type = "ether"; - networkConfig = { - Address = [ "${network.address}/24" ]; - Gateway = "${network.gateway}"; - DNS = network.nameservers; - DHCP = "no"; - }; - }; } ] ++ defaultModules ++ modules; @@ -259,9 +261,9 @@ rec { specialArgs.inputs = inputsMod; specialArgs.self = self; modules = (if (settings.type != "microvm") then - defaultModules ++ [ ../${host}/configuration.nix ] + (makeNetwork settings.network) ++ defaultModules ++ [ ../${host}/configuration.nix ] else - makeMicroVM "${host}" settings.network [ + (makeNetwork settings.network) ++ makeMicroVM "${host}" settings.network [ inputs.microvm.nixosModules.microvm ../${host}/configuration.nix ]); diff --git a/machines/testvm/configuration.nix b/machines/testvm/configuration.nix index b338fbc..26afea6 100644 --- a/machines/testvm/configuration.nix +++ b/machines/testvm/configuration.nix @@ -51,7 +51,6 @@ in services.acpid.enable = true; networking.hostName = "testvm"; - networking.networkmanager.enable = true; time.timeZone = "Europe/Berlin"; system.stateVersion = "23.05"; # Do.. Not.. Change..