Files
dev/configs/nixos/registry/desktop-keybind.nix

47 lines
1.2 KiB
Nix

{ lib, ... }:
{
checks = [
{
assertion = entries: lib.all (entry: entry.value.keys != [ ]) entries;
message = "Desktop keybinds must set at least one key.";
}
];
type = lib.types.submodule {
options = {
keys = lib.mkOption {
type = lib.types.listOf lib.types.str;
example = [
"SUPER"
"Return"
];
description = "Sets the ordered key parts for this desktop keybind.";
};
action = lib.mkOption {
type = lib.types.submodule {
freeformType = lib.types.attrsOf lib.types.anything;
options.type = lib.mkOption {
type = lib.types.enum [
"exec"
"focus"
"move-window"
"resize-window"
"toggle-floating"
"fullscreen"
"layout"
"close-window"
"kill-window"
"focus-workspace"
"move-to-workspace"
];
description = "Selects the desktop action this keybind triggers.";
};
};
description = "Declares the desktop action for this keybind.";
};
};
};
}