use gruvbox material

This commit is contained in:
js0ny 2025-11-29 23:40:48 +00:00
parent 384114d2ca
commit 91b011a725
33 changed files with 607 additions and 221 deletions

View file

@ -1,55 +1,113 @@
{
lib,
config,
pkgs,
...
}: {
options.currentUser = {
defaultShell = lib.mkOption {
type = lib.types.enum ["zsh" "bash" "fish"];
default = "zsh";
description = "The default shell to use.";
}: let
inherit (lib) mkOption types mkIf;
cfg = config.my; # 简写引用,方便后续使用
in {
options.my = {
# === 软件生态配置 (Software Ecosystem) ===
desktop = {
preferredApps = {
shell = mkOption {
type = types.package;
default = pkgs.bash;
description = "The default shell package to use.";
example = pkgs.zsh;
};
interactiveShell = mkOption {
type = types.package;
default = pkgs.bash;
description = "The default interactive shell package. (spawn by terminal emulators)";
example = pkgs.fish;
};
terminal = {
package = mkOption {
type = types.package;
default = pkgs.alacritty;
description = "The default terminal emulator package.";
example = pkgs.kitty;
};
execArg = mkOption {
type = types.str;
default = "-e";
description = "The argument used to execute a command in the terminal.";
};
};
fileManager = {
gui = mkOption {
type = types.package;
default = pkgs.thunar;
description = "The default GUI file explorer.";
example = pkgs.kdePackages.dolphin;
};
tui = mkOption {
type = types.package;
default = pkgs.yazi;
description = "The default TUI file explorer.";
example = pkgs.ranger;
};
};
};
style = {
iconTheme = {
# 分离包和名称:有些包名和主题名不一致
package = mkOption {
type = types.package;
default = pkgs.kdePackages.breeze-icons;
description = "The package containing the icon theme.";
example = pkgs.papirus-icon-theme;
};
light = mkOption {
type = types.str;
default = "Breeze";
description = "The internal name of the icon theme (as used in GTK/QT settings).";
example = "Papirus-Light";
};
dark = mkOption {
type = types.str;
default = "Breeze-Dark";
description = "The internal name of the dark icon theme (as used in GTK/QT settings).";
example = "Papirus-Dark";
};
};
};
};
defaultTerminal = lib.mkOption {
type = lib.types.str;
default = "ghostty";
description = "The default terminal emulator.";
};
# === 硬件/主机特性配置 (Hardware/Host Specifics) ===
hardware = {
# 使用 nullOr 允许该功能被完全禁用(如果在没有背光的台式机上)
keyboardBacklight = mkOption {
type = types.nullOr (types.submodule {
options = {
device = mkOption {
type = types.str;
description = "Device identifier for brightnessctl.";
};
step = mkOption {
type = types.str;
default = "5%"; # 稍微调小默认步进,更精细
description = "Step percentage/integer for brightness adjustment.";
};
};
});
default = null;
description = "Keyboard backlight configuration. Set to null to disable.";
};
defaultTerminalRunner = lib.mkOption {
type = lib.types.str;
default = config.currentUser.defaultTerminal;
description = "The default terminal emulator to run CLI softwares directly";
};
defaultExplorer = lib.mkOption {
type = lib.types.str;
default = "thunar";
description = "The default file explorer";
};
defaultTerminalExplorer = lib.mkOption {
type = lib.types.str;
default = "yazi";
description = "The default file explorer with TUI";
};
iconTheme = lib.mkOption {
type = lib.types.str;
default = "Breeze";
description = "Default icon theme";
};
};
options.currentHost = {
keyboardBacklightDevice = lib.mkOption {
type = lib.types.str;
default = "";
description = "Device Identifier that used for brightnessctl, get the identifier via brightnessctl --list";
};
keyboardBacklightStep = lib.mkOption {
type = lib.types.str;
default = "34%";
description = "Step to change keyboard backlight, integer or percentage accepted";
isHeadless = mkOption {
type = types.bool;
default = false;
description = "Whether the current host acts as a headless server.";
};
};
};
}

View file

@ -12,6 +12,8 @@
runAsRoot = true;
swtpm.enable = true;
};
onShutdown = "shutdown";
onBoot = "ignore";
};
users.users.js0ny = {
extraGroups = ["libvirtd"];