about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--flake.nix61
-rw-r--r--system/default.nix9
2 files changed, 44 insertions, 26 deletions
diff --git a/flake.nix b/flake.nix
index d6130388..b01ed4de 100644
--- a/flake.nix
+++ b/flake.nix
@@ -52,39 +52,52 @@
     snap-sync,
     shell-library,
     ...
-  } @ inputs: {
-    nixosConfigurations.Tiamat = nixpkgs.lib.nixosSystem rec {
+  } @ inputs: let
+    pkgs = nixpkgs.legacyPackages.x86_64-linux;
+  in {
+    nixosConfigurations.Tiamat = let
+      sysLib = import ./lib {inherit pkgs shell-library;};
       system = "x86_64-linux";
-      specialArgs = inputs;
-      modules = [
-        ./hosts/desktop/configuration.nix
-        agenix.nixosModules.default
+    in
+      nixpkgs.lib.nixosSystem {
+        inherit system;
+        specialArgs =
+          pkgs.lib.recursiveUpdate inputs
+          sysLib;
+        modules = [
+          ./hosts/desktop/configuration.nix
+          agenix.nixosModules.default
 
-        home-manager.nixosModules.home-manager
-        {
-          home-manager = {
-            useGlobalPkgs = true;
-            useUserPackages = true;
-            users.soispha = import ./home-manager;
-            extraSpecialArgs = {
-              inherit strip_js_comments;
-              inherit user_js;
-              inherit system;
-              inherit neovim_config;
-              inherit impermanence;
-              inherit snap-sync;
+          home-manager.nixosModules.home-manager
+          {
+            home-manager = {
+              useGlobalPkgs = true;
+              useUserPackages = true;
+              users.soispha = import ./home-manager;
+              extraSpecialArgs = {
+                inherit
+                  sysLib
+                  strip_js_comments
+                  user_js
+                  system
+                  neovim_config
+                  impermanence
+                  snap-sync
+                  ;
+              };
             };
-          };
-        }
-      ];
-    };
+          }
+        ];
+      };
     nixosConfigurations.Spawn = nixpkgs.lib.nixosSystem {
       system = "x86_64-linux";
       specialArgs = inputs;
       modules = [./hosts/spawn/configuration.nix];
     };
 
-    packages."x86_64-linux".default = import ./bootstrap {pkgs = nixpkgs.legacyPackages.x86_64-linux; inherit shell-library;};
+    packages."x86_64-linux".default = import ./bootstrap {
+      inherit pkgs shell-library;
+    };
 
     apps."x86_64-linux"."install" = {
       type = "app";
diff --git a/system/default.nix b/system/default.nix
index 14762c92..e065bfc9 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -1,4 +1,9 @@
-{config, ...}: {
+{
+  config,
+  pkgs,
+  shell-library,
+  ...
+}: {
   imports = [
     ./boot
     ./users # this needs to be before fileSystemLayouts
@@ -6,7 +11,7 @@
     ./font
     ./impermanence
     ./locale
-#./packages
+    #./packages
     ./sound
   ];
 }