about summary refs log tree commit diff stats
path: root/flake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix4
-rw-r--r--flake/default.nix102
-rw-r--r--flake/nixosConfigurations/default.nix24
3 files changed, 38 insertions, 92 deletions
diff --git a/flake.nix b/flake.nix
index 836c6d8e..27c61d4c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -248,6 +248,8 @@
       inherit (nixpkgs) lib;
       inherit system;
     });
+    # FIXME this `nixpkgs` misses the configs applied to the other one
+    nixpkgs_as_input = nixpkgs;
     outputs = import ./flake {
       inherit
         # core
@@ -255,7 +257,7 @@
         pkgs
         system
         sysLib
-        nixpkgs
+        nixpkgs_as_input
         # modules
         
         home-manager
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 {
diff --git a/flake/nixosConfigurations/default.nix b/flake/nixosConfigurations/default.nix
index 198d9c73..f2110eb9 100644
--- a/flake/nixosConfigurations/default.nix
+++ b/flake/nixosConfigurations/default.nix
@@ -1,35 +1,15 @@
 {
   system,
   pkgs,
-  nixpkgs,
-  sysLib,
+  nixpkgs_as_input,
   # configs
   defaultModules,
   defaultSpecialArgs,
-  # bins
-  video_pause,
-  yambar_cpu,
-  yambar_memory,
-  strip_js_comments,
-  river_init_lesser,
-  grades,
-  shell_library,
-  # external deps
-  user_js,
-  neovim_config,
-  snap-sync,
-  templates,
-  # modules
-  impermanence,
-  home-manager,
-  agenix,
-  serverphone,
-  disko,
   ...
 }: let
   generateHost = name: {
     name = "${name}";
-    value = nixpkgs.lib.nixosSystem {
+    value = nixpkgs_as_input.lib.nixosSystem {
       inherit system pkgs;
       specialArgs = defaultSpecialArgs;
       modules =