forked from Fediversity/Fediversity
WIP: illustrate an entire NixOS configuration as a resource
This commit is contained in:
parent
71446a891f
commit
4b031652f7
1 changed files with 27 additions and 0 deletions
|
@ -23,6 +23,33 @@ in
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
|
resources.nixos-configuration = {
|
||||||
|
description = "An entire NixOS configuration";
|
||||||
|
request =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
_class = "fediversity-resource-request";
|
||||||
|
options.config = mkOption {
|
||||||
|
description = "Any options from NixOS";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
policy =
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
_class = "fediversity-resource-policy";
|
||||||
|
|
||||||
|
options = {
|
||||||
|
extra-config = mkOptions {
|
||||||
|
description = "Any options from NixOS";
|
||||||
|
};
|
||||||
|
apply = mkOption {
|
||||||
|
type = with types; functionTo raw;
|
||||||
|
default = requests: lib.mkMerge (requests ++ [ config.extra-config ]);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
resources.login-shell = {
|
resources.login-shell = {
|
||||||
description = "The operator needs to be able to log into the shell";
|
description = "The operator needs to be able to log into the shell";
|
||||||
request =
|
request =
|
||||||
|
|
Loading…
Add table
Reference in a new issue