refactor(treewide): clean-up, flatten, rework module system

This commit is contained in:
ooks-io 2024-06-05 22:56:07 +12:00
parent 4ddf9d2b35
commit 5590c8a951
58 changed files with 397 additions and 635 deletions

View file

@ -1,43 +1,6 @@
{ lib, config, ... }:
let
cfg = config.ooknet.desktop.terminal;
in
{
imports = [
./foot
./kitty
./foot.nix
./kitty.nix
];
options.ooknet.desktop.terminal = {
foot = {
enable = lib.mkEnableOption "Enable foot terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set foot as default terminal in environment variables";
};
};
kitty = {
enable = lib.mkEnableOption "Enable kitty terminal";
default = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Set kitty as default terminal in environment variables";
};
};
};
config = {
assertions = [
{
assertion =
(lib.length (lib.filter (x: x) [
cfg.foot.default or false
cfg.kitty.default or false
]) <= 1);
message = "Only one terminal can be default in the configuration";
}
];
};
}