From a1902d312df94df5db6e18e63698f1672e63b79f Mon Sep 17 00:00:00 2001
From: albert <albert@sysctl.io>
Date: Sun, 9 Feb 2025 20:56:56 -0800
Subject: [PATCH] Rearrange things

---
 home-manager/image.nix |  6 +++---
 lib/default.nix        |  2 +-
 nixos/base.nix         | 27 +++++++++++++++++++++++++++
 nixos/default.nix      |  2 +-
 nixos/small.nix        | 16 +---------------
 5 files changed, 33 insertions(+), 20 deletions(-)
 create mode 100644 nixos/base.nix

diff --git a/home-manager/image.nix b/home-manager/image.nix
index 84034a31..c30279ff 100644
--- a/home-manager/image.nix
+++ b/home-manager/image.nix
@@ -1,4 +1,4 @@
-{ lib, inputs, hostname, username, desktop, hmStateVersion, system, isimage, ... }: {
+{ lib, inputs, hostname, username, desktop, hmStateVersion, isImage, ... }: {
   imports = [ 
     # Common configs
     ./common/software/cli
@@ -16,10 +16,10 @@
   ++ lib.optional (builtins.isString desktop) ./common/software/gui                    # GUI packages
   ++ lib.optional (builtins.isString desktop) ./common/desktops/${desktop}             # Machine-agnostic desktop configs
   ++ lib.optional (builtins.isString desktop) ./hosts/${hostname}/desktops/${desktop}  # Machine-specific desktop configs
-  ++ lib.optional (builtins.isString isiamge) ./common/image-specific.nix              # Image specific items
+  ++ lib.optional (builtins.isString isImage) ./common/image-specific.nix              # Image specific items
   ;
 
-  programs.atuin.enable = mkDefault false; 
+  programs.atuin.enable = lib.mkDefault false; 
   
   news.display = "silent";
   home = {
diff --git a/lib/default.nix b/lib/default.nix
index 8ebf2f17..211714e7 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -175,7 +175,7 @@
     format = format;
 
     modules = [
-      ../nixos/small.nix
+      ../nixos/base.nix
       ../nixos/common/modules/installer.nix
       inputs.sops-nix.nixosModules.sops
     ];
diff --git a/nixos/base.nix b/nixos/base.nix
new file mode 100644
index 00000000..24de6d15
--- /dev/null
+++ b/nixos/base.nix
@@ -0,0 +1,27 @@
+{ inputs, lib,hostname, username, desktop, ... }: {
+  imports = [ 
+    # Services
+    ./common/services/tailscale.nix
+    ./common/services/promtail.nix
+    ./common/services/telegraf.nix
+
+    # NixOS Modules
+    ./common/modules/networking.nix      # Initial Networking configs
+    ./common/modules/nixos.nix           # Common NixOS Configurations
+    ./common/modules/remote-builders.nix # Add remote builders
+
+    ./users/${username}
+    ./hosts/${hostname}
+  ]; 
+ 
+  documentation = {
+    enable = false;
+    man.enable = false;
+    info.enable = false;
+    doc.enable = false; 
+    dev.enable = false;
+    nixos.enable = false;
+  };
+ 
+  programs.fish.enable = true;
+}
diff --git a/nixos/default.nix b/nixos/default.nix
index 803ea39f..01fb7542 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -1,4 +1,4 @@
-{ inputs, lib, hostname, username, desktop, ... }: {
+{ ... }: {
   imports = [ 
     # Modules
     ./small.nix
diff --git a/nixos/small.nix b/nixos/small.nix
index 0e6572ed..49258063 100644
--- a/nixos/small.nix
+++ b/nixos/small.nix
@@ -1,14 +1,12 @@
 { inputs, lib,hostname, username, desktop, ... }: {
   imports = [ 
     # Modules
+    ./base.nix
     inputs.disko.nixosModules.disko
     
     # Services
     ./common/services/openssh.nix
     ./common/services/fail2ban.nix
-    ./common/services/tailscale.nix
-    ./common/services/promtail.nix
-    ./common/services/telegraf.nix
 
     # Software
     ./common/software/cli/scripts.nix
@@ -19,17 +17,5 @@
     ./common/modules/nixos.nix           # Common NixOS Configurations
     ./common/modules/remote-builders.nix # Add remote builders
 
-    ./users/${username}
-    ./hosts/${hostname}
   ] ++ lib.optional (builtins.isString desktop) ./common/desktops/${desktop};
- 
-  documentation = {
-    enable = false;
-    man.enable = false;
-    info.enable = false;
-    doc.enable = false; 
-    dev.enable = false;
-    nixos.enable = false;
-  };
-  programs.fish.enable = true;
 }