From f16f74b4d5aacff05040176fae5f2a796726d2de Mon Sep 17 00:00:00 2001 From: _cry64 Date: Fri, 13 Feb 2026 22:13:35 +1000 Subject: [PATCH] IM FUCKING SISYPHUS --- cerulean/nexus/nexus.nix | 1 + cerulean/nixos-module/default.nix | 5 +-- cerulean/nixos-module/home-manager.nix | 10 +++++- cerulean/nixos-module/nixpkgs.nix | 44 ++++++++++++++++++++------ 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/cerulean/nexus/nexus.nix b/cerulean/nexus/nexus.nix index ae8fe38..7466bb8 100644 --- a/cerulean/nexus/nexus.nix +++ b/cerulean/nexus/nexus.nix @@ -192,6 +192,7 @@ in { // { inherit root specialArgs; inherit (node) system; + _deploy-rs = deploy-rs; }; in specialArgs; diff --git a/cerulean/nixos-module/default.nix b/cerulean/nixos-module/default.nix index d657021..f15b236 100644 --- a/cerulean/nixos-module/default.nix +++ b/cerulean/nixos-module/default.nix @@ -13,7 +13,8 @@ # limitations under the License. { root, - deploy-rs, + system, + _deploy-rs, ... } @ args: { imports = [ @@ -26,6 +27,6 @@ ]; environment.systemPackages = [ - deploy-rs.packages.default + _deploy-rs.packages.${system}.default ]; } diff --git a/cerulean/nixos-module/home-manager.nix b/cerulean/nixos-module/home-manager.nix index 4c41280..e693ac9 100644 --- a/cerulean/nixos-module/home-manager.nix +++ b/cerulean/nixos-module/home-manager.nix @@ -32,10 +32,18 @@ in { |> filter (x: pathExists (root + "/homes/${x}")) |> (x: lib.genAttrs x (y: import (root + "/homes/${y}"))); - extraSpecialArgs = specialArgs; + # extraSpecialArgs = specialArgs; sharedModules = [ + # user configuration + # (import (root + "/nixpkgs.nix")) (import (root + "/nixpkgs.nix")) + # options declarations + # (import ./nixpkgs.nix (args // {contextName = "homes";})) (import ./nixpkgs.nix (args // {contextName = "homes";})) ]; + + # disable home-manager trying anything fancy + # we control the pkgs now!! + # useGlobalPkgs = true; }; } diff --git a/cerulean/nixos-module/nixpkgs.nix b/cerulean/nixos-module/nixpkgs.nix index 9db5d3d..c5a97f7 100644 --- a/cerulean/nixos-module/nixpkgs.nix +++ b/cerulean/nixos-module/nixpkgs.nix @@ -66,25 +66,49 @@ in { decl |> mapAttrs ( name: args: - assert args ? source - || abort '' - ${toString ./.} - `nixpkgs.channels.${contextName}.${name} missing required attribute "source"` - ''; - ((removeAttrs args ["source"]) - // {inherit system;}) - |> import args.source - |> lib.mkOverride 200 + lib.mkForce ( + # builtins.trace "SAVE ME GOT NAME: ${name}" ( + assert args ? source + || abort '' + ${toString ./.} + `nixpkgs.channels.${contextName}.${name}` missing required attribute "source" + ''; + ((removeAttrs args ["source"]) + // {inherit system;}) + |> import args.source + # DEBUG: |> lib.mkOverride 200 + ) + # ) ); in { # NOTE: _module.args is a special option that allows us to # NOTE: set extend specialArgs from inside the modules. # "pkgs" is unique since the nix module system already handles it - _module.args = removeAttrs repos ["pkgs"]; + # DEBUG: _module.args = lib.mkOverride 200 ( + # _module.args = ( + # if contextName == "hosts" + # then repos + # else + # assert ( + # repos + # |> builtins.attrNames + # |> map (x: "\"${x}\"") + # |> builtins.concatStringsSep " " + # |> (x: "FUCK YOU SO BAD: { ${x} }") + # |> abort + # ); + # removeAttrs repos ["pkgs"] + # ); + _module.args = repos; nixpkgs = if contextName == "hosts" then {flake.source = lib.mkIf (decl ? pkgs) (lib.mkOverride 200 decl.pkgs.source);} + else if contextName == "homes" + then { + config = decl.pkgs.config or {}; + overlays = decl.pkgs.overlays or {}; + } else {}; }; }