diff options
| author | Jakub Stachurski <j.stachurski@student.utwente.nl> | 2026-01-28 14:50:36 +0100 |
|---|---|---|
| committer | Jakub Stachurski <j.stachurski@student.utwente.nl> | 2026-01-28 14:50:36 +0100 |
| commit | fb26a8a59b840c6430c73df6c1cc44ecff156b67 (patch) | |
| tree | 0080c92ff0ece08db825000ed8cf6f83d557cc70 /hosts/omega-relay | |
| parent | 19835b9be47ba9b96b1f72c93c98e3c3866a858a (diff) | |
Little fixes and update
Diffstat (limited to 'hosts/omega-relay')
| -rw-r--r-- | hosts/omega-relay/default.nix | 1 | ||||
| -rw-r--r-- | hosts/omega-relay/disko.nix | 25 | ||||
| -rw-r--r-- | hosts/omega-relay/hardware-configuration.nix | 20 |
3 files changed, 42 insertions, 4 deletions
diff --git a/hosts/omega-relay/default.nix b/hosts/omega-relay/default.nix index 17af116..dcb7466 100644 --- a/hosts/omega-relay/default.nix +++ b/hosts/omega-relay/default.nix @@ -9,6 +9,7 @@ ./firewall.nix ./disko.nix ./vm.nix + ./hardware-configuration.nix ../../services/mysql.nix ../../services/email.nix ../../services/vaultwarden.nix diff --git a/hosts/omega-relay/disko.nix b/hosts/omega-relay/disko.nix index 307f6de..adfaf71 100644 --- a/hosts/omega-relay/disko.nix +++ b/hosts/omega-relay/disko.nix @@ -1,14 +1,31 @@ { config, lib, ... }: +let + cfg = config.hosts.omega-relay; +in { - config = lib.mkIf (!config.addons.virtualisation.isTestVM) ({ + options.hosts.omega-relay = with lib; { + root_device = mkOption { + type = types.path; + default = "/dev/sda"; + example = "/dev/sda"; + description = "Root device for disko and grub"; + }; + + do_disko = mkOption { + type = types.bool; + default = !config.addons.virtualisation.isTestVM; + description = "Whenever to do disko or not."; + }; + }; + config = lib.mkIf (cfg.do_disko) ({ services.btrfs.autoScrub = { enable = true; interval = "weekly"; }; - boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.device = cfg.root_device; # Workaround - boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ]; + boot.loader.grub.devices = lib.mkForce [ cfg.root_device ]; boot.loader.efi.canTouchEfiVariables = false; # TODO: Mount points @@ -17,7 +34,7 @@ disko.devices = { disk = { main-disk = { - device = "/dev/sda"; + device = cfg.root_device; type = "disk"; content = { type = "gpt"; diff --git a/hosts/omega-relay/hardware-configuration.nix b/hosts/omega-relay/hardware-configuration.nix new file mode 100644 index 0000000..247b382 --- /dev/null +++ b/hosts/omega-relay/hardware-configuration.nix @@ -0,0 +1,20 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + hosts.omega-relay.root_device = "/dev/vda"; + hosts.omega-relay.do_disko = true; + addons.virtualisation.isTestVM = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} |
