1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2024-12-29 00:53:52 +00:00
ultima/libx/options.nix

22 lines
570 B
Nix
Raw Normal View History

2024-12-09 01:15:55 +00:00
{ lib, ... }:
with lib;
let
def = { default = false; };
null = { default = null; };
in with types; {
# enable = true; ++ enable = false;
True = { enable = true; };
False = { enable = false; };
# mkOption and mkEnableOption
mkEnable = mkEnableOption "";
mkBool = mkOption def // { type = bool; };
mkOpt = {
str = mkOption def // { type = str; };
list = {
pkgs = mkOption null // { type = listOf package; };
str = mkOption null // { type = listOf str; };
};
attrs = { str = mkOption null // { type = attrsOf str; }; };
};
}