1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2024-12-29 19:03:52 +00:00
ultima/libx/options.nix
2024-12-20 22:10:11 +09:00

52 lines
785 B
Nix

{
inputs,
pkgs,
lib,
...
}:
let
def = {
default = false;
};
null = {
default = null;
};
in
with lib;
with lib.types;
rec {
# ylib
ypkgs = inputs.nypkgs.legacyPackages.${pkgs.system};
umport = ypkgs.lib.umport;
# 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;
};
};
};
}