From 4197474fecf1f76ac94db940018f3a650b9ac4a4 Mon Sep 17 00:00:00 2001 From: Gonne Date: Mon, 18 Dec 2023 17:52:53 +0100 Subject: [PATCH] Differentiate hardware and vms in roles --- nixos/machines/ghatanothoa/configuration.nix | 1 + nixos/roles/default.nix | 3 +-- nixos/roles/hardware.nix | 6 ++++++ nixos/roles/vm.nix | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 nixos/roles/hardware.nix create mode 100644 nixos/roles/vm.nix diff --git a/nixos/machines/ghatanothoa/configuration.nix b/nixos/machines/ghatanothoa/configuration.nix index 3b4faa5..207e37f 100644 --- a/nixos/machines/ghatanothoa/configuration.nix +++ b/nixos/machines/ghatanothoa/configuration.nix @@ -3,6 +3,7 @@ ./hardware-configuration.nix ../../modules/jitsi.nix ../../roles + ../../roles/vm.nix ./network.nix ]; diff --git a/nixos/roles/default.nix b/nixos/roles/default.nix index 60284a7..2936ac3 100644 --- a/nixos/roles/default.nix +++ b/nixos/roles/default.nix @@ -1,16 +1,15 @@ { pkgs, lib, - modulesPath, ... }: { imports = [ ./admins.nix ./nix_keys.nix ./prometheusNodeExporter.nix - (modulesPath + "/virtualisation/xen-domU.nix") ../modules/impermanence.nix ]; + nix = { extraOptions = '' experimental-features = nix-command flakes diff --git a/nixos/roles/hardware.nix b/nixos/roles/hardware.nix new file mode 100644 index 0000000..f182583 --- /dev/null +++ b/nixos/roles/hardware.nix @@ -0,0 +1,6 @@ +{ + # Use grub as bootloader. + # Systemd-boot does not support our legacy BIOS hardware, + # but only runs on UEFI systems. + boot.loader.grub.enable = true; +} diff --git a/nixos/roles/vm.nix b/nixos/roles/vm.nix new file mode 100644 index 0000000..32fba6d --- /dev/null +++ b/nixos/roles/vm.nix @@ -0,0 +1,5 @@ +{modulesPath, ...}: { + imports = [ + (modulesPath + "/virtualisation/xen-domU.nix") + ]; +}