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,9 +1,14 @@
{
currentUser = {
defaultShell = "zsh";
defaultTerminal = "kitty";
iconTheme = "Papirus";
defaultExplorer = "dolphin";
defaultTerminalExplorer = "yazi";
{pkgs, ...}: {
my = {
desktop = {
preferredApps = {
shell = pkgs.zsh;
interactiveShell = pkgs.fish;
terminal = {
package = pkgs.kitty;
execArg = "-e";
};
};
};
};
}

View file

@ -9,7 +9,7 @@ in {
imports = [
../../modules/home/options.nix
../../modules/home/do-not-track.nix
./config.nix
# ./config.nix
];
home.username = username;
home.homeDirectory =
@ -29,6 +29,4 @@ in {
enable = true;
};
};
home.sessionVariables.TERMINAL = config.currentUser.defaultTerminal;
}

View file

@ -16,7 +16,6 @@
age
aichat
beancount
gnumake
chezmoi
curlie
duf
@ -67,6 +66,7 @@
jless
unar
trash-cli
aria2
]
++ (
if pkgs.stdenv.isDarwin

View file

@ -0,0 +1,28 @@
{
pkgs,
config,
...
}: {
# Globally installed development tools
home.packages = with pkgs; [
vscode-json-languageserver
alejandra
gnumake
nil
jq
yq-go
tokei
socat
shellcheck
];
home.sessionVariables = {
CARGO_HOME = "${config.xdg.dataHome}/cargo";
GOPATH = "${config.xdg.dataHome}/go";
PYTHON_HISTORY = "${config.xdg.stateHome}/python/history";
};
systemd.user.tmpfiles.rules = [
"d ${config.xdg.dataHome}/cargo 0755 ${config.home.username} users -"
"d ${config.xdg.dataHome}/go 0755 ${config.home.username} users -"
"f ${config.xdg.stateHome}/python 0755 ${config.home.username} users -"
];
}

View file

@ -79,7 +79,43 @@ in {
sockets = ["wayland"];
};
};
xdg.dataFile = appWrappers;
# xdg.dataFile = appWrappers;
xdg.dataFile =
{
# Patch for Hyprland (scale XWayland by hand)
"flatpak/exports/bin/com.qq.QQ" = {
text = ''
#!/bin/sh
EXTRA_APP_ARGS=""
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
EXTRA_APP_ARGS="--force-device-scale-factor=1.5"
fi
exec flatpak run --branch=stable --arch=x86_64 com.qq.QQ "$EXTRA_APP_ARGS" "$@"
'';
enable = true;
executable = true;
};
"flatpak/exports/share/applications/com.qq.QQ.desktop" = {
text = ''
[Desktop Entry]
Name=QQ
Exec=${config.xdg.dataHome}/flatpak/exports/bin/com.qq.QQ
Terminal=false
Type=Application
Icon=com.qq.QQ
StartupWMClass=QQ
Categories=Network;
Comment=QQ
X-Flatpak=com.qq.QQ
'';
enable = true;
force = true;
};
}
// appWrappers;
home.activation.patchFlatpakDesktopFiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
${lib.concatMapStringsSep "\n" (appid: ''
DESKTOP_FILE="${config.xdg.dataHome}/flatpak/exports/share/applications/${appid}.desktop"

View file

@ -67,10 +67,10 @@ in {
neovim.enable = false;
firefox = {
profileNames = ["default"];
colorTheme.enable = false; # Firefox Color
};
};
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml";
image = ./wallpaper.jpg;
polarity = "dark";
};

View file

@ -1,6 +1,7 @@
{
pkgs,
config,
lib,
...
}: {
home.sessionVariables = {
@ -46,7 +47,7 @@
"org/gnome/desktop/interface" = {
clock-show-seconds = true;
clock-show-weekday = true;
icon-theme = "${config.currentUser.iconTheme}";
icon-theme = "${config.my.desktop.style.iconTheme.dark}";
accent-color = "pink";
show-battery-percentage = true;
cursor-theme = "Adwaita";
@ -111,12 +112,12 @@
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-1" = {
name = "Open Terminal via Win-R";
command = "${config.currentUser.defaultTerminal}";
command = "${lib.getExe config.my.desktop.preferredApps.terminal.package}";
binding = "<Super>r";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-2" = {
name = "Open Terminal via Ctrl-Alt-T";
command = "${config.currentUser.defaultTerminal}";
command = "${lib.getExe config.my.desktop.preferredApps.terminal.package}";
binding = "<Ctrl><Alt>t";
};
"org/gnome/settings-daemon/plugins/media-keys" = {

View file

@ -29,7 +29,7 @@
position = "center";
};
workspace = {
iconTheme = "${config.currentUser.iconTheme}";
iconTheme = "${config.my.desktop.style.iconTheme.dark}";
colorScheme = "BreezeDark";
};
kwin = {

View file

@ -4,14 +4,13 @@
lib,
...
}: let
term = config.currentUser.defaultTerminal;
termRunner = config.currentUser.defaultTerminalRunner;
iconTheme = config.currentUser.iconTheme;
explorer = config.currentUser.defaultExplorer;
explorerTerm = config.currentUser.defaultTerminalExplorer;
term = lib.getExe config.my.desktop.preferredApps.terminal.package;
iconTheme = config.my.desktop.style.iconTheme.dark;
explorer = lib.getExe config.my.desktop.preferredApps.fileManager.gui;
explorerTerm = lib.getExe config.my.desktop.preferredApps.fileManager.tui;
launcher = "walker";
kbdBacklightDev = config.currentHost.keyboardBacklightDevice;
kbdBacklightStep = config.currentHost.keyboardBacklightStep;
kbdBacklightDev = config.my.hardware.keyboardBacklight.device;
kbdBacklightStep = config.my.hardware.keyboardBacklight.step;
mainMod = "SUPER";
screenshotPath = "$HOME/Pictures/Screenshots/\"$(%Y-%m-%d_%H-%M-%S.png)\"";
my = import ./scripts.nix {inherit pkgs;};
@ -22,7 +21,7 @@ in {
bind = [
# === Run Applications ===
"$mainMod, return, exec, ${term}"
"$mainMod SHIFT, return, exec, ${termRunner} --directory ~/Atelier -e nvim"
"$mainMod SHIFT, return, exec, ${term} --directory ~/Atelier -e nvim"
"$mainMod, B, exec, ${lib.getExe my.launch-or-focus} firefox firefox"
"$mainMod SHIFT, B, exec, firefox --private-window"
"$mainMod, A, exec, kitty --class=kitty-terminal-popup -e aichat --session"
@ -34,11 +33,11 @@ in {
''$mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"''
"$mainMod SHIFT, M, fullscreen"
"$mainMod, W, exec, ${launcher} -m windows"
"$mainMod, Apostrophe, exec, EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=${termRunner}-terminal-popup -e edit-clipboard --minimal"
"$mainMod, Apostrophe, exec, EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=${term}-terminal-popup -e edit-clipboard --minimal"
"$mainMod, V, exec, ${launcher} -m clipboard"
"alt, space, exec, ${launcher} -m desktopapplications"
"$mainMod, E, exec, ${explorer}"
"$mainMod SHIFT, E, exec, ${termRunner} -e ${explorerTerm}"
"$mainMod SHIFT, E, exec, ${term} -e ${explorerTerm}"
"CTRL ALT, DELETE, exec, uwsm exit"
"$mainMod, P, pseudo"
"$mainMod, Y, togglesplit"

View file

@ -11,6 +11,7 @@
# Right Top
"float, pin, size 25%, move 73% 10%, class:^(org.pulseaudio.pavucontrol)$"
"float, pin, size 25%, move 73% 10%, class:^(.bluetooth-manager-wrapped)$"
# Right Top + no focus
"noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(org.kde.(dolphin|ark))$, title:^(Extracting|Compressing)(.*)$"
"noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(thunar)$, title:^(File Operation Progress)$"

View file

@ -4,14 +4,12 @@
lib,
...
}: let
term = config.currentUser.defaultTerminal;
termRunner = config.currentUser.defaultTerminalRunner;
iconTheme = config.currentUser.iconTheme;
explorer = config.currentUser.defaultExplorer;
explorerTerm = config.currentUser.defaultTerminalExplorer;
term = lib.getExe config.my.desktop.preferredApps.terminal.package;
# TODO: Don't default to dark
iconTheme = config.my.desktop.style.iconTheme.dark;
launcher = "walker";
kbdBacklightDev = config.currentHost.keyboardBacklightDevice;
kbdBacklightStep = config.currentHost.keyboardBacklightStep;
kbdBacklightDev = config.my.hardware.keyboardBacklight.device;
kbdBacklightStep = config.my.hardware.keyboardBacklight.step;
nirictl = import ./scripts.nix {inherit pkgs;};
in {
home.packages = [
@ -23,7 +21,7 @@ in {
"Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox";
"Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode";
"Mod+Shift+B".action = spawn "firefox" "--private-window";
"Mod+A".action = spawn-sh "${termRunner} --class=terminal-popup -e aichat --session";
"Mod+A".action = spawn-sh "${term} --class=terminal-popup -e aichat --session";
"Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)";
"Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio";
"Mod+O".hotkey-overlay.title = "Focus or launch Obsidian";
@ -31,12 +29,12 @@ in {
# TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser
"Mod+E".hotkey-overlay.title = "Focus or launch file explorer";
"Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin";
"Mod+T".action = spawn-sh "${termRunner} --class=terminal-popup";
"Mod+Shift+T".action = spawn-sh "${termRunner} --class=${termRunner}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop";
"Mod+T".action = spawn-sh "${term} --class=terminal-popup";
"Mod+Shift+T".action = spawn-sh "${term} --class=${term}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop";
"Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier";
"Mod+Apostrophe".action =
spawn-sh "EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal";
spawn-sh "EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal";
"Mod+Shift+Slash".action = show-hotkey-overlay;

View file

@ -0,0 +1,87 @@
{...}: {
workspaces = [
{
id = 1;
name = "Master";
matches = [
{
class = "firefox";
}
];
}
{
id = 2;
name = "Project";
matches = [
{
class = "code|dev.zed.Zed|Vitis IDE|Vivado";
}
];
}
{
id = 3;
name = "Info";
matches = [
{
class = "discord|thunderbird|QQ|wechat|com.(telegram|ayugram).desktop|io.github.kukuruzka165.materialgram";
}
];
}
{
id = 9;
name = "Background";
matches = [
{
class = "feishin|Cider";
}
];
}
];
float-top-right-pin = [
{
class = "org.pulseaudio.pavucontrol";
}
{
class = ".bluetooth-manager-wrapped";
}
];
float-center = [
{
class = "com.(telegram|ayugram).desktop";
title = "Media viewer";
}
{
class = "io.github.kukuruzka165.materialgram";
title = "Media viewer";
}
{
class = "wechat";
title = "";
}
{
class = "QQ";
title = "";
}
{
class = "QQ";
title = "";
}
{
class = "CherryStudio";
title = "Cherry Studio Quick Assistant";
}
{
class = "anki";
title = "Add";
}
{
class = "kitty-terminal-popup";
}
{
title = "Open File||Select a File||Choose wallpaper|Open Folder|Save As||Library|File Upload(.*)";
}
{
class = "qt6ct";
}
];
}

View file

@ -20,6 +20,7 @@
nix-ts-mode
flycheck
highlight-indent-guides
magit
];
};
# TODO: tdlib version is too high

View file

@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}: {
programs.ghostty = {
@ -14,7 +15,7 @@
else true;
# Not ready
settings = {
command = "${config.currentUser.defaultShell}";
command = "${lib.getExe config.my.desktop.preferredApps.interactiveShell}";
font-size = 13;
font-family = "Maple Mono NF CN";
# theme = light:Catppuccin Latte,dark:Catppuccin Mocha;

View file

@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}: let
alt =
@ -8,6 +9,7 @@
then "cmd"
else "alt";
in {
xdg.configFile."kitty/kitty.conf".force = true;
programs.kitty = {
enable = true;
shellIntegration = {
@ -41,7 +43,7 @@ in {
macos_option_as_alt = true;
macos_quit_when_last_window_closed = true;
enabled_layouts = "splits";
shell = config.currentUser.defaultShell;
shell = lib.getExe config.my.desktop.preferredApps.interactiveShell;
allow_remote_control = "socket-only";
listen_on = "unix:/tmp/kitty.sock";
confirm_os_window_close = 0;
@ -82,4 +84,33 @@ in {
}
else {};
};
programs = {
bash.bashrcExtra = ''
if [ "$TERM" = "xterm-kitty" ]; then
alias ssh="kitty +kitten ssh"
alias icat="kitty +kitten icat"
fi
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
alias clip="kitty +kitten clipboard"
fi
'';
zsh.initContent = ''
if [ "$TERM" = "xterm-kitty" ]; then
alias ssh="kitty +kitten ssh"
alias icat="kitty +kitten icat"
fi
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
alias clip="kitty +kitten clipboard"
fi
'';
fish.interactiveShellInit = ''
if test "$TERM" = "xterm-kitty"
abbr --add ssh "kitty +kitten ssh"
abbr --add icat "kitty +kitten icat"
end;
if test -n "$SSH_CLIENT" -o -n "$SSH_TTY"
abbr --add clip "kitty +kitten clipboard"
end;
'';
};
}

View file

@ -1,8 +1,12 @@
{
pkgs,
config,
lib,
...
}: {
}: let
term = lib.getExe config.my.desktop.preferredApps.terminal.package;
termArg = config.my.desktop.preferredApps.terminal.execArg;
in {
home.packages = [pkgs.miniserve];
home.file.".local/share/kio/servicemenus/miniserve.desktop" = {
enable = true;
@ -20,7 +24,7 @@
Name=Map Directory to Port 8080
Name[CN]=(8080)
Icon=network-server
Exec=${config.currentUser.defaultTerminalRunner} -t "miniserve" -e miniserve "%f" --port 8080
Exec=${term} --title "miniserve" ${termArg} miniserve "%f" --port 8080
'';
};
}

View file

@ -1,4 +1,26 @@
{...}: {
{pkgs, ...}: let
dailyNote = pkgs.writeShellScriptBin "daily-note" ''
VAULT_DIR="$HOME/Obsidian/00 - Journal/Daily"
DATE_STR=$(date +%Y-%m-%d)
FILE_PATH="$VAULT_DIR/$DATE_STR.md"
if [ ! -d "$VAULT_DIR" ]; then
mkdir -p "$VAULT_DIR"
fi
if [ ! -f "$FILE_PATH" ]; then
echo "# $DATE_STR" > "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "## Highlights" >> "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "## Log" >> "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "- $(date +%H:%M) " >> "$FILE_PATH"
fi
nvim + "$FILE_PATH"
'';
in {
imports = [
./vimrc-support.nix
];
@ -11,4 +33,18 @@
};
};
};
home.packages = [
dailyNote
];
programs = {
bash.shellAliases = {
dn = "daily-note";
};
zsh.shellAliases = {
dn = "daily-note";
};
fish.shellAbbrs = {
dn = "daily-note";
};
};
}

View file

@ -1,58 +1,71 @@
{pkgs}: let
{
pkgs,
lib,
config,
...
}: let
inherit (lib) optionalAttrs;
isDarwin = pkgs.stdenv.isDarwin;
isLinux = pkgs.stdenv.isLinux;
isHeadless = config.my.hardware.isHeadless;
commonAliases = {
ni = "touch";
cls = "clear";
aic = "aichat -s";
aicc = "aichat -c";
nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs";
clip = "wl-copy";
paste = "wl-paste";
py = "nix run 'nixpkgs#python314'"; # Python Interactive Shell
py = "nix run 'nixpkgs#python3'";
};
darwinAliases = {
reboot = "sudo reboot";
clip = "pbcopy";
paste = "pbpaste";
ii = "open";
brewi = "brew install";
brewr = "brew remove";
brewu = "brew upgrade && brew update";
brewc = "brew cleanup";
brewl = "brew list";
};
linuxAliases = {
ii = "xdg-open";
open = "xdg-open";
};
linuxGuiAliases = {
clip = "wl-copy";
paste = "wl-paste";
};
posixFx = ''
mt() {
mkdir -p $(dirname $1) && touch $1
mkdir -p "$(dirname "$1")" && touch "$1"
}
mtv() {
mkdir -p $(dirname $1) && touch $1 && nvim $1
mkdir -p "$(dirname "$1")" && touch "$1" && $EDITOR "$1"
}
'';
fishFx = ''
function mt
mkdir -p (dirname $argv[1]) && touch $argv[1]
end
function mtv
mkdir -p (dirname $argv[1]) && touch $argv[1] && nvim $argv[1]
mkdir -p (dirname $argv[1]) && touch $argv[1] && $EDITOR $argv[1]
end
'';
in {
aliases =
commonAliases
// (
if pkgs.stdenv.isLinux
then linuxAliases
else {}
)
// (
if pkgs.stdenv.isDarwin
then darwinAliases
else {}
);
// (optionalAttrs isDarwin darwinAliases)
// (optionalAttrs isLinux (
linuxAliases // (optionalAttrs (!isHeadless) linuxGuiAliases)
));
inherit posixFx fishFx;
}

View file

@ -1,5 +1,10 @@
{pkgs, ...}: let
aliasCfg = import ./aliases.nix {pkgs = pkgs;};
{
pkgs,
config,
lib,
...
}: let
aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in {
programs.bash = {
enable = true;

View file

@ -1,5 +1,10 @@
{pkgs, ...}: let
aliasCfg = import ./aliases.nix {pkgs = pkgs;};
{
pkgs,
config,
lib,
...
}: let
aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in {
programs.fish = {
enable = true;
@ -42,7 +47,11 @@ in {
bind -M insert alt-delete kill-line
'';
# preferAbbrs = true;
shellAbbrs = aliasCfg.aliases;
shellAbbrs =
aliasCfg.aliases
// {
l = "ls -lah";
};
};
programs.zed-editor.extensions = ["fish"];
}
}

View file

@ -1,6 +1,4 @@
{pkgs, ...}: let
aliases = import ./aliases.nix {pkgs = pkgs;};
in {
{...}: {
programs.nushell = {
enable = true;
shellAliases = {

View file

@ -1,9 +1,10 @@
{
config,
pkgs,
config,
lib,
...
}: let
aliasCfg = import ./aliases.nix {pkgs = pkgs;};
aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in {
home.packages = with pkgs; [
zsh-fzf-tab

View file

@ -1,5 +1,14 @@
{pkgs, ...}: let
{
pkgs,
config,
...
}: let
codeAlias = {"c" = "code";};
codeReleasesConfigDir = [
"Code"
"VSCodium"
"Antigravity"
];
in {
programs.vscode = {
package = pkgs.vscode;
@ -17,6 +26,17 @@ in {
];
};
# Remove default snippet dir before running this to avoid conflicts
xdg.configFile = builtins.listToAttrs (map (dir: {
name = "${dir}/User/snippets";
value = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/lsp-snippets/snippets";
force = true;
# recursive = true;
};
})
codeReleasesConfigDir);
catppuccin.vscode.profiles.default.enable = false;
programs.fish.shellAbbrs = codeAlias;
programs.bash.shellAliases = codeAlias;

View file

@ -1,4 +1,9 @@
{pkgs, ...}: {
{
pkgs,
config,
...
}: {
xdg.configFile."zed/snippets".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/lsp-snippets/snippets";
programs.zed-editor = {
enable = true;
package =

View file

@ -1,5 +1,9 @@
# ~/.config/nixcfgs/users/js0ny/default.nix
{...}: {
{
pkgs,
config,
...
}: {
imports = [
# General config
./default.nix
@ -10,6 +14,7 @@
# Packages
./packages/cli.nix
./packages/gui.nix
./packages/devtools.nix
./packages/flatpak.nix
./packages/fonts.nix
./packages/stylix.nix
@ -83,10 +88,31 @@
nixpkgs.config.allowUnfree = true;
currentHost = {
keyboardBacklightDevice = "asus::kbd_backlight";
keyboardBacklightStep = "1";
my = {
desktop = {
preferredApps = {
shell = pkgs.zsh;
interactiveShell = pkgs.fish;
terminal = {
package = pkgs.kitty;
execArg = "-e";
};
fileManager = {
gui = pkgs.kdePackages.dolphin;
tui = pkgs.yazi;
};
};
};
hardware = {
keyboardBacklight = {
device = "asus::kbd_backlight";
step = "1";
};
isHeadless = false;
};
};
home.sessionVariables.TERMINAL = config.my.desktop.preferredApps.terminal.package;
home.stateVersion = "25.05";
}