Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions projects/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ in
with types;
submodule {
options = {
services = mkOption {
modules.services = mkOption {
type = nullOr (attrsOf (nullOr types'.service));
default = null;
};
programs = mkOption {
modules.programs = mkOption {
type = nullOr (attrsOf (nullOr types'.program));
default = null;
};
Expand Down
49 changes: 28 additions & 21 deletions projects/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
mkOption
;
in
{
rec {
subgrant =
with types;
submodule {
Expand Down Expand Up @@ -97,7 +97,7 @@ in
options = {
module = mkOption {
description = "the example must be a NixOS module in a file";
type = pathInStore;
type = deferredModule;
};
description = mkOption {
description = "description of the example, ideally with further instructions on how to use it";
Expand All @@ -119,25 +119,32 @@ in
# TODO: port modular services to programs
program =
with types;
submodule {
options = {
module = mkOption {
type = deferredModule;
};
examples = mkOption {
type = attrsOf (nullOr example);
default = { };
};
extensions = mkOption {
type = attrsOf (nullOr plugin);
default = { };
};
links = mkOption {
type = attrsOf link;
default = { };
submodule (
{ name, ... }:
{
options = {
name = mkOption {
type = with types; nullOr str;
default = name;
};
module = mkOption {
type = deferredModule;
};
examples = mkOption {
type = attrsOf (nullOr example);
default = { };
};
extensions = mkOption {
type = attrsOf (nullOr plugin);
default = { };
};
links = mkOption {
type = attrsOf link;
default = { };
};
};
};
};
}
);

# TODO: make use of modular services https://github.com/NixOS/nixpkgs/pull/372170
service =
Expand All @@ -151,7 +158,7 @@ in
default = name;
};
module = mkOption {
type = moduleType;
type = deferredModule;
};
examples = mkOption {
type = nullOr (attrsOf (nullOr example));
Expand Down