IM FUCKING SISYPHUS
This commit is contained in:
parent
52044bd998
commit
f16f74b4d5
4 changed files with 47 additions and 13 deletions
|
|
@ -192,6 +192,7 @@ in {
|
||||||
// {
|
// {
|
||||||
inherit root specialArgs;
|
inherit root specialArgs;
|
||||||
inherit (node) system;
|
inherit (node) system;
|
||||||
|
_deploy-rs = deploy-rs;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
specialArgs;
|
specialArgs;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
{
|
{
|
||||||
root,
|
root,
|
||||||
deploy-rs,
|
system,
|
||||||
|
_deploy-rs,
|
||||||
...
|
...
|
||||||
} @ args: {
|
} @ args: {
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -26,6 +27,6 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
deploy-rs.packages.default
|
_deploy-rs.packages.${system}.default
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,18 @@ in {
|
||||||
|> filter (x: pathExists (root + "/homes/${x}"))
|
|> filter (x: pathExists (root + "/homes/${x}"))
|
||||||
|> (x: lib.genAttrs x (y: import (root + "/homes/${y}")));
|
|> (x: lib.genAttrs x (y: import (root + "/homes/${y}")));
|
||||||
|
|
||||||
extraSpecialArgs = specialArgs;
|
# extraSpecialArgs = specialArgs;
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
|
# user configuration
|
||||||
|
# (import (root + "/nixpkgs.nix"))
|
||||||
(import (root + "/nixpkgs.nix"))
|
(import (root + "/nixpkgs.nix"))
|
||||||
|
# options declarations
|
||||||
|
# (import ./nixpkgs.nix (args // {contextName = "homes";}))
|
||||||
(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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,25 +66,49 @@ in {
|
||||||
decl
|
decl
|
||||||
|> mapAttrs (
|
|> mapAttrs (
|
||||||
name: args:
|
name: args:
|
||||||
assert args ? source
|
lib.mkForce (
|
||||||
|| abort ''
|
# builtins.trace "SAVE ME GOT NAME: ${name}" (
|
||||||
${toString ./.}
|
assert args ? source
|
||||||
`nixpkgs.channels.${contextName}.${name} missing required attribute "source"`
|
|| abort ''
|
||||||
'';
|
${toString ./.}
|
||||||
((removeAttrs args ["source"])
|
`nixpkgs.channels.${contextName}.${name}` missing required attribute "source"
|
||||||
// {inherit system;})
|
'';
|
||||||
|> import args.source
|
((removeAttrs args ["source"])
|
||||||
|> lib.mkOverride 200
|
// {inherit system;})
|
||||||
|
|> import args.source
|
||||||
|
# DEBUG: |> lib.mkOverride 200
|
||||||
|
)
|
||||||
|
# )
|
||||||
);
|
);
|
||||||
in {
|
in {
|
||||||
# NOTE: _module.args is a special option that allows us to
|
# NOTE: _module.args is a special option that allows us to
|
||||||
# NOTE: set extend specialArgs from inside the modules.
|
# NOTE: set extend specialArgs from inside the modules.
|
||||||
# "pkgs" is unique since the nix module system already handles it
|
# "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 =
|
nixpkgs =
|
||||||
if contextName == "hosts"
|
if contextName == "hosts"
|
||||||
then {flake.source = lib.mkIf (decl ? pkgs) (lib.mkOverride 200 decl.pkgs.source);}
|
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 {};
|
else {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue