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
71 changes: 64 additions & 7 deletions projects/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,69 @@ in
subgrant =
with types;
submodule {
options = lib.genAttrs [ "Commons" "Core" "Entrust" "Review" ] (
name:
mkOption {
type = listOf str;
default = [ ];
}
);
options =
lib.genAttrs
[
"Commons"
"Core"
"Entrust"
"Review"
]
(
name:
mkOption {
type = listOf str;
default = [ ];
}
);
};

link =
with types;
submodule (
{ name, ... }:
{
options = {
text = mkOption {
description = "link text";
type = str;
default = name;
};
description = mkOption {
description = "long-form description of the linked resource";
type = nullOr str;
default = null;
};
# TODO: add syntax checking
url = mkOption {
type = str;
};
};
}
);

binary =
with types;
submodule (
{ name, ... }:
{
options = {
name = mkOption {
type = str;
default = name;
};
data = mkOption {
type = nullOr (either path package);
default = null;
};
};
}
);

# TODO: plugins are actually component *extensions* that are of component-specific type,
# and which compose in application-specific ways defined in the application module.
# this also means that there's no fundamental difference between programs and services,
# and even languages: libraries are just extensions of compilers.
# TODO: implement this, now that we're using the module system
plugin = with types; anything;
}