2024-05-21 13:22:03 +00:00
|
|
|
# This is an example of a blank module.
|
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.host.services.myModule;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
host.services.myModule = {
|
|
|
|
enable = lib.mkEnableOption (lib.mdDoc "Enables this example module.");
|
|
|
|
attributes = lib.mkOption {
|
|
|
|
default = { };
|
|
|
|
type = lib.types.attrs;
|
|
|
|
description = "An example of an attributes option.";
|
|
|
|
};
|
|
|
|
string = lib.mkOption {
|
|
|
|
default = "";
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "An example of a string option.";
|
|
|
|
};
|
|
|
|
list = lib.mkOption {
|
|
|
|
default = [ ];
|
|
|
|
type = lib.types.listOf lib.types.int;
|
|
|
|
description = "An example of a list (of integers) option.";
|
|
|
|
};
|
|
|
|
enum = mkOption {
|
|
|
|
default = "one";
|
|
|
|
type = types.enum [
|
|
|
|
"one"
|
|
|
|
"two"
|
|
|
|
];
|
|
|
|
description = "An example of an enum option.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-05-22 20:47:55 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2024-05-21 13:22:03 +00:00
|
|
|
# Add changes applied by this module here.
|
|
|
|
};
|
|
|
|
}
|