Files
nixos-config/home/duynguyen/default.nix
T

249 lines
6.4 KiB
Nix

{ config, pkgs, lib, inputs, ... }:
let
wallpaperDir = "${config.home.homeDirectory}/.config/wallpapers";
defaultWallpaper = "${wallpaperDir}/even-in-arcadia.png";
# Thin wrapper so niri keybinds can call noctalia msg <args>
# without hard-coding the nix-store path.
noctaliaIpc = pkgs.writeShellScriptBin "noctalia-ipc" ''
set -eu
exec noctalia msg "$@"
'';
in
{
imports = [
inputs.noctalia.homeModules.default
];
home.username = "duynguyen";
home.homeDirectory = "/home/duynguyen";
home.stateVersion = "26.05";
# home-manager's fontconfig module references removed nodePackages;
# NixOS manages fontconfig at the system level anyway
fonts.fontconfig.enable = false;
home.packages = with pkgs; [
noctaliaIpc
# Browsers
zen-browser
claude-desktop
# Terminals
ghostty
kitty
foot
# Niri supporting tools
xwayland-satellite # X11 app support in Niri
xdg-utils # xdg-open, file associations
inotify-tools # filesystem event tools
# Polkit agent for Niri session (graphical auth dialogs)
kdePackages.polkit-kde-agent-1
# Editor
vscodium
# Daily apps
mpv
imv
gimp
obs-studio
zathura
thunar
xfce.thunar-archive-plugin
xfce.tumbler
ffmpegthumbnailer
xarchiver
grim
slurp
swappy
libreoffice
telegram-desktop
pavucontrol
blueman
# Clipboard
cliphist
wl-clipboard
# CLI tools
vim
neovim
tmux
fastfetch
btop
ripgrep
fd
fzf
eza
bat
dust
jq
yq
shellcheck
ffmpeg
imagemagick
unzip
p7zip
wiremix
# System control
brightnessctl
playerctl
# Dev tools
gh
];
# Required for Electron apps (VSCodium, Zen Browser, etc.) to use
# Wayland natively and work correctly with fcitx5 input
home.sessionVariables.NIXOS_OZONE_WL = "1";
# Wallpapers folder — add images to home/duynguyen/wallpapers/ in the repo
# and rebuild; noctalia reads from ~/.config/wallpapers
xdg.configFile."wallpapers".source = ./wallpapers;
# Polkit agent as a systemd user service so it starts with the Niri session
systemd.user.services.polkit-kde-agent = {
Unit = {
Description = "KDE Polkit Authentication Agent";
PartOf = [ "graphical-session.target" ];
After = [ "graphical-session.target" ];
};
Service = {
ExecStart = "${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
};
Install.WantedBy = [ "graphical-session.target" ];
};
# ── Noctalia ──────────────────────────────────────────────────────────────
# Replaces: waybar, walker, swaylock, swaybg, swayidle, mako
programs.noctalia = {
enable = true;
settings = {
bar.default = {
start = [ "launcher" "clipboard" "cpu" "network" "ram" ];
center = [ "clock" ];
end = [ "notifications" "volume" "brightness" "battery" "control-center" "session" ];
thickness = 40;
padding = 10;
radius = 0;
margin_edge = 0;
margin_ends = 0;
widget_spacing = 8;
};
idle = {
behavior_order = [ "lock" "screen-off" ];
behavior = {
lock = {
action = "lock";
enabled = true;
timeout = 600; # 10 min
};
screen-off = {
action = "screen_off";
enabled = true;
timeout = 660;
};
};
};
lockscreen.wallpaper = defaultWallpaper;
nightlight.enabled = true;
osd.position = "top_right";
shell = {
font_family = "JetBrainsMono Nerd Font";
polkit_agent = true;
corner_radius_scale = 0.0;
animation.speed = 1.5;
panel = {
clipboard_placement = "attached";
launcher_placement = "attached";
launcher_session_search = true;
};
shadow.alpha = 0.5;
};
theme.builtin = "Kanagawa";
wallpaper = {
enabled = true;
directory = wallpaperDir;
default.path = defaultWallpaper;
};
};
};
# ── Shell ─────────────────────────────────────────────────────────────────
programs.zsh = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
};
programs.kitty = {
enable = true;
settings.wheel_scroll_multiplier = 10;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.starship.enable = true;
programs.git = {
enable = true;
settings.user = {
name = "duynguyen";
email = "huonghaiduynhim@gmail.com";
};
};
# ── KDE Plasma (for the Plasma session; dark theme + touchpad) ────────────
programs.plasma = {
enable = true;
workspace.lookAndFeel = "org.kde.breezedark.desktop";
input.touchpads = [
{
name = "SynPS/2 Synaptics TouchPad";
vendorId = "2";
productId = "7";
naturalScroll = true;
pointerSpeed = 0.4;
scrollSpeed = 0.75;
}
];
};
# ── Zen Browser scroll speed ──────────────────────────────────────────────
home.activation.zenBrowserUserJs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
for profile in "$HOME/.config/zen/"*.*/; do
[[ -d "$profile" ]] || continue
echo 'user_pref("mousewheel.default.delta_multiplier_y", 50);' > "$profile/user.js"
done
'';
# ── Niri config ───────────────────────────────────────────────────────────
xdg.configFile."niri/config.kdl".source =
pkgs.runCommand "niri-config-checked"
{ nativeBuildInputs = [ pkgs.niri ]; }
''
niri validate -c ${./config/niri/config.kdl}
cp ${./config/niri/config.kdl} $out
'';
programs.home-manager.enable = true;
}