zaphyra's git: nixfiles

zaphyra's nixfiles

commit 47bb39a8329c8b29928e701c41356374468883ec
parent f8ff8efbc82cc16470ff886afd002b81845650c6
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sun, 3 Aug 2025 18:22:16 +0200

config/nixos/modules/presets: add `minimal`
7 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/config/nixos/modules/presets/base.nix b/config/nixos/modules/presets/base.nix
@@ -23,10 +23,6 @@ in
   config = lib.mkIf cfg.enable {
     boot.kernel.sysctl."kernel.sysrq" = lib.mkDefault 1;
 
-    environment.defaultPackages = lib.mkForce [ ];
-
-    programs.command-not-found.enable = false;
-
     # make things more declerative
     services.userborn.enable = lib.mkDefault true;
     users.mutableUsers = lib.mkForce false;
diff --git a/config/nixos/modules/presets/minimal.nix b/config/nixos/modules/presets/minimal.nix
@@ -0,0 +1,63 @@
+{
+  povSelf,
+  pkgs,
+  lib,
+  config,
+  hostConfig,
+  modulesPath,
+  ...
+}:
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options = {
+    enable = {
+      type = types.bool;
+      default = false;
+    };
+  };
+
+  config = lib.mkIf cfg.enable {
+
+    boot.enableContainers = lib.mkDefault false;
+
+    system.disableInstallerTools = lib.mkDefault true;
+
+    documentation = {
+      enable = lib.mkDefault false;
+      doc.enable = lib.mkDefault false;
+      info.enable = lib.mkDefault false;
+      man.enable = lib.mkDefault false;
+      nixos.enable = lib.mkDefault false;
+    };
+
+    environment = {
+      defaultPackages = lib.mkDefault [ ];
+      stub-ld.enable = lib.mkDefault false;
+    };
+
+    programs = {
+      less.lessopen = lib.mkDefault null;
+      command-not-found.enable = lib.mkDefault false;
+      fish.generateCompletions = lib.mkDefault false;
+    };
+
+    services = {
+      logrotate.enable = lib.mkDefault false;
+      udisks2.enable = lib.mkDefault false;
+    };
+
+    xdg = {
+      autostart.enable = lib.mkDefault false;
+      icons.enable = lib.mkDefault false;
+      mime.enable = lib.mkDefault false;
+      sounds.enable = lib.mkDefault false;
+    };
+
+  };
+
+}+
\ No newline at end of file
diff --git a/config/nixos/modules/presets/zaphyra/enable.nix b/config/nixos/modules/presets/zaphyra/enable.nix
@@ -52,8 +52,11 @@ in
 
           hardware.smartcard.enable = lib.mkDefault config.modules.presets.graphical.enable;
 
-          presets.zaphyra = {
-            syncthing.enable = lib.mkDefault true;
+          presets = {
+            minimal.enable = true;
+            zaphyra = {
+              syncthing.enable = lib.mkDefault true;
+            };
           };
 
           services = {
diff --git a/hosts/huntii/default.nix b/hosts/huntii/default.nix
@@ -19,7 +19,6 @@
 
   configuration =
     {
-      modulesPath,
       config,
       pkgs,
       lib,

@@ -27,10 +26,6 @@
     }:
     {
 
-      imports = [
-        (modulesPath + "/profiles/minimal.nix")
-      ];
-
       specialisation.gnome.configuration = {
         modules.presets.graphical.type = lib.mkForce "gnomeMinimal";
       };
diff --git a/hosts/morio/default.nix b/hosts/morio/default.nix
@@ -29,7 +29,6 @@
 
   configuration =
     {
-      modulesPath,
       inputs,
       config,
       pkgs,

@@ -38,7 +37,6 @@
     {
 
       imports = [
-        (modulesPath + "/profiles/minimal.nix")
         ./dn42.nix
       ];
 
diff --git a/hosts/novus/default.nix b/hosts/novus/default.nix
@@ -29,7 +29,6 @@
 
   configuration =
     {
-      modulesPath,
       inputs,
       config,
       lib,

@@ -39,7 +38,6 @@
     {
 
       imports = [
-        (modulesPath + "/profiles/minimal.nix")
         ./dn42.nix
       ];
 
diff --git a/hosts/polaris/default.nix b/hosts/polaris/default.nix
@@ -27,7 +27,6 @@
 
   configuration =
     {
-      modulesPath,
       inputs,
       hostConfig,
       config,

@@ -38,7 +37,6 @@
     {
 
       imports = [
-        (modulesPath + "/profiles/minimal.nix")
         ./syncthing.nix
       ];