Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions projects/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in
(
name:
mkOption {
description = "subgrants under the ${name} fund";
type = listOf str;
default = [ ];
}
Expand Down Expand Up @@ -105,7 +106,7 @@ in
};
tests = mkOption {
description = "at least one test for the example";
type = nonEmtpyAttrs test;
type = nonEmtpyAttrs (nullOr test);
};
links = mkOption {
description = "links to related resources";
Expand All @@ -115,5 +116,35 @@ in
};
};

test = with types; nullOr (either deferredModule package);
# TODO: make use of modular services https://github.com/NixOS/nixpkgs/pull/372170
service =
with types;
submodule (
{ name, ... }:
{
options = {
name = mkOption {
type = nullOr str;
default = name;
};
module = mkOption {
type = moduleType;
};
examples = mkOption {
type = nullOr (attrsOf (nullOr example));
default = null;
};
extensions = mkOption {
type = nullOr (attrsOf (nullOr plugin));
default = null;
};
links = mkOption {
type = attrsOf link;
default = { };
};
};
};
};

test = with types; either deferredModule package;
}