From dca3fc21572087e39eb20d089235c4fbbc20e0e8 Mon Sep 17 00:00:00 2001
From: Benoit Donneaux <benoit@leastauthority.com>
Date: Fri, 24 Nov 2023 11:40:45 +0100
Subject: [PATCH] Simplify config leaving default values

Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
---
 morph/grid/hro-cloud/storage001-config.nix | 2 --
 morph/grid/hro-cloud/storage002-config.nix | 2 --
 morph/grid/hro-cloud/storage003-config.nix | 1 -
 nixos/modules/100tb.nix                    | 5 +++--
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/morph/grid/hro-cloud/storage001-config.nix b/morph/grid/hro-cloud/storage001-config.nix
index 39d6d1b2..0bd4c2fb 100644
--- a/morph/grid/hro-cloud/storage001-config.nix
+++ b/morph/grid/hro-cloud/storage001-config.nix
@@ -5,6 +5,4 @@
   "prefixLength" = 24;
   "gateway" = "185.225.209.1";
   "gatewayInterface" = "eno1";
-  "grubDeviceID" = "nodev"; #might be wrong
-  "systemd-boot" = false;
 }
diff --git a/morph/grid/hro-cloud/storage002-config.nix b/morph/grid/hro-cloud/storage002-config.nix
index 9d04bbf8..3ae425ad 100644
--- a/morph/grid/hro-cloud/storage002-config.nix
+++ b/morph/grid/hro-cloud/storage002-config.nix
@@ -5,6 +5,4 @@
   "prefixLength" = 29;
   "gateway" = "38.170.241.33";
   "gatewayInterface" = "eno1";
-  "grubDeviceID" = "nodev"; #nodev if we want to use efi (double check)
-  "systemd-boot" = false;
 }
diff --git a/morph/grid/hro-cloud/storage003-config.nix b/morph/grid/hro-cloud/storage003-config.nix
index 188bdd5a..6893df50 100644
--- a/morph/grid/hro-cloud/storage003-config.nix
+++ b/morph/grid/hro-cloud/storage003-config.nix
@@ -5,7 +5,6 @@
   "prefixLength" = 24;
   "gateway" = "151.80.28.254";
   "gatewayInterface" = "eno3";
-  #"grubDeviceID" = "nodev";
   "grubDeviceID" = "nvme-eui.e8238fa6bf530001001b448b463b77bf";
   "systemd-boot" = true;
 }
diff --git a/nixos/modules/100tb.nix b/nixos/modules/100tb.nix
index 55da3783..505fe270 100644
--- a/nixos/modules/100tb.nix
+++ b/nixos/modules/100tb.nix
@@ -68,10 +68,11 @@ let
     { type = lib.types.str;
       example = "wwn-0x5000c500936410b9";
       description = "The ID of the disk on which to install grub.";
+      default = "nodev";
     };
     systemd-boot = lib.mkOption
     { type = lib.types.bool;
-      example = false;
+      default = false;
       description = "Fill later";
     };
 
@@ -110,7 +111,7 @@ in {
   { boot.loader.grub.enable = true;
     boot.loader.grub.version = 2;
     boot.loader.grub.device = if cfg.grubDeviceID == "nodev"  then "nodev" else "/dev/disk/by-id/${cfg.grubDeviceID}";
-    boot.loader.systemd-boot.enable = if cfg.systemd-boot == ""  then false else cfg.systemd-boot; 
+    boot.loader.systemd-boot.enable = cfg.systemd-boot; 
     boot.loader.timeout = 10;
     networking.firewall.enable = false;
 
-- 
GitLab