IM FUCKING SISYPHUS

This commit is contained in:
do butterflies cry? 2026-02-13 22:13:35 +10:00
parent 52044bd998
commit f16f74b4d5
4 changed files with 47 additions and 13 deletions

View file

@ -192,6 +192,7 @@ in {
// {
inherit root specialArgs;
inherit (node) system;
_deploy-rs = deploy-rs;
};
in
specialArgs;

View file

@ -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
];
}

View file

@ -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;
};
}

View file

@ -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 {};
};
}