Initial commit
This commit is contained in:
commit
cfcc57a8bd
353 changed files with 18756 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
# it is possible for top-level aspects directly under
|
||||
# den.aspects to take a context argument.
|
||||
{ den, lib, ... }:
|
||||
let
|
||||
# A module to test that toplevel had context.
|
||||
topLevel = name: {
|
||||
config.tops = name;
|
||||
options.tops = lib.mkOption { type = lib.types.str; };
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
den.aspects.toplevel-user =
|
||||
{ user, ... }:
|
||||
{
|
||||
nixos.imports = [ (topLevel user.name) ];
|
||||
};
|
||||
|
||||
den.aspects.toplevel-host =
|
||||
{ host, ... }:
|
||||
{
|
||||
homeManager.imports = [ (topLevel host.name) ];
|
||||
};
|
||||
|
||||
den.aspects.alice.includes = [
|
||||
den.aspects.toplevel-host
|
||||
den.aspects.toplevel-user
|
||||
];
|
||||
|
||||
perSystem =
|
||||
{
|
||||
checkCond,
|
||||
alice-at-rockhopper,
|
||||
rockhopper,
|
||||
...
|
||||
}:
|
||||
{
|
||||
checks.alice-toplevel-user = checkCond "alice toplevel param aspect" (
|
||||
rockhopper.config.tops == "alice"
|
||||
);
|
||||
|
||||
checks.alice-toplevel-host = checkCond "alice toplevel param aspect" (
|
||||
alice-at-rockhopper.tops == "rockhopper"
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue