diff options
Diffstat (limited to 'hosts/omega-relay/disko.nix')
| -rw-r--r-- | hosts/omega-relay/disko.nix | 25 |
1 files changed, 21 insertions, 4 deletions
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"; |
