about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/default.nix16
-rw-r--r--hosts/phobos/disks.nix4
2 files changed, 12 insertions, 8 deletions
diff --git a/hosts/default.nix b/hosts/default.nix
index e2ea6d4..deaad5a 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -1,4 +1,4 @@
-{ lib, inputs, isNixOS, nixpkgs, home-manager, ... }:
+{ lib, inputs, extraModules, isNixOS, isIso, nixpkgs, home-manager, ... }:
 let
   user = "baitinq";
 
@@ -10,18 +10,22 @@ let
     { hostname = "vm"; system = "x86_64-linux"; timezone = secrets.main_timezone; location = secrets.main_location; }
   ];
 
-  mkHost = { hostname, system, timezone, location }: isNixOS:
+  mkHost = { hostname, system, timezone, location }: extraModules: isNixOS: isIso:
     let
       pkgs = import nixpkgs {
         inherit system;
-        config.allowUnfree = true; # Allow proprietary software
+        config = {
+          allowUnfree = true;
+          allowBroken = true;
+        };
         overlays = [
           inputs.nur.overlay
           (import ../packages)
           (import ../overlays)
         ];
       };
-      extraArgs = { inherit pkgs inputs user secrets hostname timezone location; };
+      extraArgs = { inherit pkgs inputs isIso user secrets hostname timezone location; };
+      extraSpecialModules = if isIso then extraModules ++ [ "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" ] else extraModules;
     in
     if isNixOS
     then
@@ -44,7 +48,7 @@ let
                 ];
               };
             }
-          ];
+          ] ++ extraSpecialModules;
         }
     else
       home-manager.lib.homeManagerConfiguration
@@ -62,4 +66,4 @@ in
     Map each element of the list applying the mkHost function to its elements and returning a set in the listToAttrs format
     builtins.listToAttrs on the result
   */
-builtins.listToAttrs (map ({ hostname, system, timezone, location }: { name = hostname; value = mkHost { inherit hostname system timezone location; } isNixOS; }) hosts)
+builtins.listToAttrs (map ({ hostname, system, timezone, location }: { name = hostname; value = mkHost { inherit hostname system timezone location; } extraModules isNixOS isIso; }) hosts)
diff --git a/hosts/phobos/disks.nix b/hosts/phobos/disks.nix
index 9f1906e..6f005bf 100644
--- a/hosts/phobos/disks.nix
+++ b/hosts/phobos/disks.nix
@@ -1,4 +1,4 @@
-{ config, lib, inputs, pkgs, modulesPath, ... }:
+{ config, lib, inputs, pkgs, modulesPath, isIso, ... }:
 {
   fileSystems."/" = {
     device = "none";
@@ -33,7 +33,7 @@
 
   swapDevices = [ ];
 
-  services.btrfs.autoScrub.enable = true;
+  services.btrfs.autoScrub.enable = if !isIso then true else false;
 
   zramSwap.enable = true;