mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
fix(home): add systemConfig alias and standalone placeholders
This commit is contained in:
23
flake.nix
23
flake.nix
@@ -96,11 +96,32 @@
|
|||||||
src = self;
|
src = self;
|
||||||
inputs = inputs // {
|
inputs = inputs // {
|
||||||
self = { };
|
self = { };
|
||||||
|
home-manager = {
|
||||||
|
lib.hm = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
eval = builtins.tryEval (builtins.attrNames lib.snowfall);
|
standalone-home = lib.snowfall.home.create-home {
|
||||||
|
path = ./flake.nix;
|
||||||
|
name = "test@${system}";
|
||||||
|
inherit system;
|
||||||
|
};
|
||||||
|
standalone-special-args = standalone-home.specialArgs;
|
||||||
|
eval = builtins.tryEval {
|
||||||
|
snowfall-attrs = builtins.attrNames lib.snowfall;
|
||||||
|
has-standalone-home-placeholders =
|
||||||
|
(standalone-special-args ? osConfig)
|
||||||
|
&& (standalone-special-args.osConfig == null)
|
||||||
|
&& (standalone-special-args ? systemConfig)
|
||||||
|
&& (standalone-special-args.systemConfig == null);
|
||||||
|
has-system-config-aliases =
|
||||||
|
(builtins.length (builtins.split "systemConfig = config;" (builtins.readFile ./modules/nixos/user/default.nix)) > 1)
|
||||||
|
&& (builtins.length (builtins.split "systemConfig = config;" (builtins.readFile ./modules/darwin/user/default.nix)) > 1);
|
||||||
|
};
|
||||||
in
|
in
|
||||||
assert eval.success;
|
assert eval.success;
|
||||||
|
assert eval.value.has-standalone-home-placeholders;
|
||||||
|
assert eval.value.has-system-config-aliases;
|
||||||
{
|
{
|
||||||
snowfall-lib-eval = pkgs.runCommand "snowfall-lib-eval" { } "mkdir -p $out";
|
snowfall-lib-eval = pkgs.runCommand "snowfall-lib-eval" { } "mkdir -p $out";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ in
|
|||||||
type = types.submoduleWith {
|
type = types.submoduleWith {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
osConfig = config;
|
osConfig = config;
|
||||||
|
systemConfig = config;
|
||||||
modulesPath = "${inputs.home-manager}/modules";
|
modulesPath = "${inputs.home-manager}/modules";
|
||||||
}
|
}
|
||||||
// config.home-manager.extraSpecialArgs;
|
// config.home-manager.extraSpecialArgs;
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ in
|
|||||||
type = types.submoduleWith {
|
type = types.submoduleWith {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
osConfig = config;
|
osConfig = config;
|
||||||
|
systemConfig = config;
|
||||||
modulesPath = "${inputs.home-manager or "/"}/modules";
|
modulesPath = "${inputs.home-manager or "/"}/modules";
|
||||||
}
|
}
|
||||||
// (config.home-manager.extraSpecialArgs or { });
|
// (config.home-manager.extraSpecialArgs or { });
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ in
|
|||||||
inherit (user-metadata) user host;
|
inherit (user-metadata) user host;
|
||||||
|
|
||||||
format = "home";
|
format = "home";
|
||||||
|
osConfig = specialArgs.osConfig or null;
|
||||||
|
systemConfig = specialArgs.systemConfig or null;
|
||||||
|
|
||||||
inputs = snowfall-lib.flake.without-src user-inputs;
|
inputs = snowfall-lib.flake.without-src user-inputs;
|
||||||
inherit (snowfall-config) namespace;
|
inherit (snowfall-config) namespace;
|
||||||
|
|||||||
Reference in New Issue
Block a user