ark/users/modules/settings/default.nix

50 lines
911 B
Nix
Raw Normal View History

2022-07-01 04:45:26 +03:00
{
config,
2022-09-12 03:32:23 +03:00
lib,
2022-07-01 04:45:26 +03:00
...
}: let
2022-10-04 02:08:44 +03:00
l = lib // builtins;
t = l.types;
2022-09-12 03:32:23 +03:00
cfg = config.settings;
in {
options = {
2022-10-04 02:08:44 +03:00
settings.iconTheme = {
name = l.mkOption {
type = t.str;
};
package = l.mkOption {
type = t.package;
};
};
2022-09-12 03:32:23 +03:00
settings.terminal = {
2022-10-04 02:08:44 +03:00
name = l.mkOption {
type = t.str;
2022-09-12 03:32:23 +03:00
};
};
settings.font = {
2022-10-04 02:08:44 +03:00
enable = l.mkOption {
type = t.bool;
2022-07-01 04:45:26 +03:00
default = false;
};
2022-10-04 02:08:44 +03:00
name = l.mkOption {
type = t.str;
};
package = l.mkOption {
type = t.package;
2022-07-01 04:45:26 +03:00
};
2022-10-04 02:08:44 +03:00
size = l.mkOption {
type = t.ints.unsigned;
2022-07-01 04:45:26 +03:00
};
2022-10-04 02:08:44 +03:00
fullName = l.mkOption {
type = t.str;
readOnly = true;
2022-07-01 04:45:26 +03:00
};
};
2022-09-12 03:32:23 +03:00
};
2022-07-01 04:45:26 +03:00
2022-10-04 02:08:44 +03:00
config = l.mkIf cfg.font.enable {
2022-09-12 03:32:23 +03:00
home.packages = [cfg.font.package];
2022-10-04 02:08:44 +03:00
settings.font.fullName = "${cfg.font.name} ${toString cfg.font.size}";
2022-09-12 03:32:23 +03:00
};
}