34 lines
571 B
Text
34 lines
571 B
Text
# comment
|
|
snippet option
|
|
lib.mkOption {
|
|
type = lib.types.$1;
|
|
default = $2;
|
|
example = "$3";
|
|
description = "$4";
|
|
};
|
|
|
|
snippet fn An empty function that takes an attribute set as a parameter.
|
|
{ $1 }:
|
|
{
|
|
$2
|
|
}
|
|
|
|
snippet module An empty module.
|
|
{ config, lib, ... }:
|
|
let
|
|
moduleName = "$2";
|
|
cfg = config.${${moduleName}};
|
|
in
|
|
{
|
|
imports = [];
|
|
|
|
options.${${moduleName}} = {
|
|
enable = lib.mkEnableOption "Enable ${${moduleName}}";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
{
|
|
$3
|
|
}
|
|
]);
|
|
}
|