forked from fediversity/fediversity
29 lines
708 B
Nix
29 lines
708 B
Nix
{ lib, ... }:
|
|
let
|
|
inherit (lib) mkOption types;
|
|
in
|
|
{
|
|
resources.nixos-module = {
|
|
description = "A NixOS configuration module to include as-is.";
|
|
request =
|
|
{ ... }:
|
|
{
|
|
_class = "fediversity-resource-request";
|
|
options = {
|
|
module = mkOption {
|
|
description = "The NixOS configuration module to include.";
|
|
type = types.unspecified; # NixOS module
|
|
};
|
|
};
|
|
};
|
|
policy =
|
|
{ ... }:
|
|
{
|
|
_class = "fediversity-resource-policy";
|
|
config = {
|
|
resource-type = types.listOf types.unspecified; # NixOS module
|
|
apply = lib.lists.map (request: request.module);
|
|
};
|
|
};
|
|
};
|
|
}
|