about summary refs log tree commit diff stats
path: root/flake/default.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-01 15:31:42 +0200
committerSoispha <soispha@vhack.eu>2023-08-01 15:42:54 +0200
commit0a608bd781dcda40144097b007fac0a0c60a8ee1 (patch)
treee69fbc1fd0e15e3b86f31f47b776df21f6f0170d /flake/default.nix
parentFix(hm/conf/gammastep): Use lighter settings on laptops (diff)
downloadnixos-config-0a608bd781dcda40144097b007fac0a0c60a8ee1.tar.gz
nixos-config-0a608bd781dcda40144097b007fac0a0c60a8ee1.zip
Refactor(treewide): Move module configuration in separate files
Diffstat (limited to 'flake/default.nix')
-rw-r--r--flake/default.nix102
1 files changed, 33 insertions, 69 deletions
diff --git a/flake/default.nix b/flake/default.nix
index 9c6e2033..aed36d6a 100644
--- a/flake/default.nix
+++ b/flake/default.nix
@@ -4,7 +4,7 @@
   pkgs,
   system,
   sysLib,
-  nixpkgs,
+  nixpkgs_as_input,
   # modules
   home-manager,
   nixos-generators,
@@ -30,73 +30,13 @@
   grades,
   flake_update,
 }: let
-  homeManagerConfig = {
-    home-manager = {
-      useGlobalPkgs = true;
-      useUserPackages = true;
-      users.soispha = import ../home-manager;
-      extraSpecialArgs = {
-        inherit
-          pkgs
-          sysLib
-          # extra information
-          
-          system
-          # bins
-          
-          video_pause
-          yambar_cpu
-          yambar_memory
-          strip_js_comments
-          river_init_lesser
-          grades
-          shell_library
-          flake_update
-          # external deps
-          
-          user_js
-          neovim_config
-          snap-sync
-          # modules
-          
-          impermanence
-          ;
-      };
-    };
-  };
-  ageConfig = import ../secrets;
-  impermanenceConfig = import ../system/impermanence;
-  defaultModules = [
-    agenix.nixosModules.default
-    ageConfig
-
-    serverphone.nixosModules.default
-
-    disko.nixosModules.default
-
-    lanzaboote.nixosModules.lanzaboote
-
-    home-manager.nixosModules.home-manager
-    homeManagerConfig
-
-    impermanence.nixosModules.impermanence
-    impermanenceConfig
-  ];
-  defaultSpecialArgs = {
-    nixpkgs-as-input = nixpkgs;
-    inherit templates sysLib serverphone system;
-  };
-in {
-  nixosConfigurations = import ./nixosConfigurations {
+  home_manager_config = import ../home-manager {
     inherit
-      system
       pkgs
-      nixpkgs
       sysLib
-      # configs
+      # extra information
       
-      defaultModules
-      defaultSpecialArgs
+      system
       # bins
       
       video_pause
@@ -112,14 +52,38 @@ in {
       user_js
       neovim_config
       snap-sync
-      templates
       # modules
       
       impermanence
-      home-manager
-      agenix
-      serverphone
-      disko
+      ;
+  };
+  defaultModules = [
+    agenix.nixosModules.default
+
+    disko.nixosModules.default
+
+    home-manager.nixosModules.home-manager
+    home_manager_config
+
+    impermanence.nixosModules.impermanence
+
+    lanzaboote.nixosModules.lanzaboote
+
+    serverphone.nixosModules.default
+  ];
+  defaultSpecialArgs = {
+    inherit templates sysLib serverphone system nixpkgs_as_input;
+  };
+in {
+  nixosConfigurations = import ./nixosConfigurations {
+    inherit
+      system
+      pkgs
+      nixpkgs_as_input
+      # configs
+      
+      defaultModules
+      defaultSpecialArgs
       ;
   };
   packages."${system}" = import ./packages {