infra/flake/den/templates/examples/modules/_example/ci/standalone-hm-special-args-osconfig.nix

32 lines
849 B
Nix
Raw Normal View History

2025-12-01 13:23:24 +07:00
let
# Example: luke standalone home-manager has access to rockhopper osConfig specialArg.
os-conditional-hm =
{ home, ... }:
{
# access osConfig, wired via extraSpecialArgs in homes.nix.
homeManager =
{ osConfig, ... }:
{
programs.bat.enable = osConfig.programs.${home.programToDependOn}.enable;
};
};
in
{
# Example: standalone-hm config depends on osConfig (non-recursive)
# NOTE: this will only work for standalone hm, and not for hosted hm
# since a hosted hm configuration cannot depend on the os configuration.
den.aspects.luke.includes = [
os-conditional-hm
];
perSystem =
{ checkCond, luke, ... }:
{
checks.luke-hm-depends-on-osConfig = checkCond "standalone hm can depend on osConfig" (
luke.config.programs.bat.enable
);
};
}