feat: replace waybar/walker/swaylock/swaybg with noctalia shell

This commit is contained in:
2026-08-13 23:14:35 +07:00
parent 97f2f2f2ff
commit 213fb53a2c
3 changed files with 142 additions and 71 deletions
+5 -1
View File
@@ -17,9 +17,12 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
claude-desktop.url = "github:k3d3/claude-desktop-linux-flake"; claude-desktop.url = "github:k3d3/claude-desktop-linux-flake";
# Noctalia: Wayland shell for Niri (bar, launcher, lock, wallpaper, idle)
# Uses its own pinned nixpkgs (needs unstable deps)
noctalia.url = "github:noctalia-dev/noctalia-shell";
}; };
outputs = { self, nixpkgs, home-manager, plasma-manager, zen-browser, claude-desktop, ... }: { outputs = { self, nixpkgs, home-manager, plasma-manager, zen-browser, claude-desktop, noctalia, ... }@inputs: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
@@ -34,6 +37,7 @@
]; ];
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager ]; home-manager.sharedModules = [ plasma-manager.homeModules.plasma-manager ];
home-manager.users.duynguyen = import ./home/duynguyen/default.nix; home-manager.users.duynguyen = import ./home/duynguyen/default.nix;
} }
+4 -7
View File
@@ -80,12 +80,8 @@ layout {
} }
} }
spawn-at-startup "waybar" spawn-at-startup "noctalia"
spawn-at-startup "xwayland-satellite" spawn-at-startup "xwayland-satellite"
spawn-at-startup "mako"
spawn-at-startup "elephant"
spawn-at-startup "sh" "-c" "walker --gapplication-service"
spawn-at-startup "start-wallpaper"
hotkey-overlay { hotkey-overlay {
skip-at-startup skip-at-startup
@@ -133,8 +129,9 @@ binds {
Mod+Shift+Slash { show-hotkey-overlay; } Mod+Shift+Slash { show-hotkey-overlay; }
Mod+T hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty"; } Mod+T hotkey-overlay-title="Open a Terminal: kitty" { spawn "kitty"; }
Mod+Space hotkey-overlay-title="Run an Application: walker" { spawn "walker"; } Mod+Space hotkey-overlay-title="Noctalia: Launcher" { spawn "noctalia-ipc" "panel-toggle" "launcher"; }
Super+Alt+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn "swaylock"; } Mod+S hotkey-overlay-title="Noctalia: Control Center" { spawn "noctalia-ipc" "panel-toggle" "control-center"; }
Super+Alt+L hotkey-overlay-title="Noctalia: Lock" { spawn "noctalia-ipc" "session" "lock"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; } XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; } XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
+124 -54
View File
@@ -1,17 +1,21 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
let let
# Picks the first image from ~/.config/wallpapers and sets it via swaybg. wallpaperDir = "${config.home.homeDirectory}/.config/wallpapers";
# Add images to home/duynguyen/wallpapers/ in the config repo and rebuild. defaultWallpaper = "${wallpaperDir}/even-in-arcadia.png";
startWallpaper = pkgs.writeShellScriptBin "start-wallpaper" ''
f=$(find "$HOME/.config/wallpapers" -maxdepth 1 -type f \ # Thin wrapper so niri keybinds can call noctalia msg <args>
\( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" \ # without hard-coding the nix-store path.
-o -name "*.gif" -o -name "*.webp" -o -name "*.avif" \) \ noctaliaIpc = pkgs.writeShellScriptBin "noctalia-ipc" ''
| sort | head -1) set -eu
[ -n "$f" ] && exec ${pkgs.swaybg}/bin/swaybg -i "$f" -m fill exec noctalia msg "$@"
''; '';
in in
{ {
imports = [
inputs.noctalia.homeModules.default
];
home.username = "duynguyen"; home.username = "duynguyen";
home.homeDirectory = "/home/duynguyen"; home.homeDirectory = "/home/duynguyen";
home.stateVersion = "26.05"; home.stateVersion = "26.05";
@@ -21,6 +25,8 @@ in
fonts.fontconfig.enable = false; fonts.fontconfig.enable = false;
home.packages = with pkgs; [ home.packages = with pkgs; [
noctaliaIpc
# Browsers # Browsers
zen-browser zen-browser
claude-desktop claude-desktop
@@ -28,23 +34,16 @@ in
# Terminals # Terminals
ghostty ghostty
kitty kitty
foot # lightweight, good default for Niri foot
# Niri supporting tools # Niri supporting tools
startWallpaper # picks wallpaper from ~/.config/wallpapers and runs swaybg
walker # app launcher
elephant # modular data provider for walker
fuzzel # app launcher (alternative)
waybar
mako # notifications
wl-clipboard # copy/paste in Wayland terminal
swaylock # screen locker
swayidle # idle management
swaybg # wallpaper setter
xwayland-satellite # X11 app support in Niri xwayland-satellite # X11 app support in Niri
xdg-utils # xdg-open, file associations xdg-utils # xdg-open, file associations
inotify-tools # filesystem event tools inotify-tools # filesystem event tools
# Polkit agent for Niri session (graphical auth dialogs)
kdePackages.polkit-kde-agent-1
# Editor # Editor
vscodium vscodium
@@ -53,22 +52,23 @@ in
imv imv
gimp gimp
obs-studio obs-studio
zathura # PDF viewer zathura
thunar # file manager thunar
xfce.thunar-archive-plugin # right-click archive operations xfce.thunar-archive-plugin
xfce.tumbler # thumbnail service xfce.tumbler
ffmpegthumbnailer # video thumbnails ffmpegthumbnailer
xarchiver # archive manager GUI xarchiver
grim # Wayland screenshot grim
slurp # region selector for grim slurp
swappy # screenshot annotation swappy
libreoffice libreoffice
telegram-desktop telegram-desktop
pavucontrol # audio GUI pavucontrol
blueman # Bluetooth GUI blueman
# Clipboard # Clipboard
cliphist # clipboard history (pairs with wl-clipboard) cliphist
wl-clipboard
# CLI tools # CLI tools
vim vim
@@ -77,23 +77,23 @@ in
fastfetch fastfetch
btop btop
ripgrep ripgrep
fd # fast find alternative fd
fzf fzf
eza # modern ls eza
bat # modern cat bat
dust # intuitive disk usage dust
jq # JSON processing jq
yq # YAML processing yq
shellcheck # shell script linter shellcheck
ffmpeg ffmpeg
imagemagick imagemagick
unzip unzip
p7zip p7zip
wiremix # TUI PipeWire audio mixer wiremix
# System control # System control
brightnessctl # brightness keys brightnessctl
playerctl # media keys playerctl
# Dev tools # Dev tools
gh gh
@@ -104,24 +104,93 @@ in
home.sessionVariables.NIXOS_OZONE_WL = "1"; home.sessionVariables.NIXOS_OZONE_WL = "1";
# Wallpapers folder — add images to home/duynguyen/wallpapers/ in the repo # Wallpapers folder — add images to home/duynguyen/wallpapers/ in the repo
# and rebuild; swaybg will pick the first one alphabetically # and rebuild; noctalia reads from ~/.config/wallpapers
xdg.configFile."wallpapers".source = ./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 = { programs.zsh = {
enable = true; enable = true;
autosuggestion.enable = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
}; };
programs.waybar = {
enable = true;
style = builtins.readFile ./config/waybar/style.css;
};
# Write config directly to avoid home-manager's waybar settings type
# conflicting with the `modules` key used by the group/drawer widget
xdg.configFile."waybar/config".source = ./config/waybar/config.json;
programs.kitty = { programs.kitty = {
enable = true; enable = true;
settings.wheel_scroll_multiplier = 10; settings.wheel_scroll_multiplier = 10;
@@ -142,6 +211,7 @@ in
}; };
}; };
# ── KDE Plasma (for the Plasma session; dark theme + touchpad) ────────────
programs.plasma = { programs.plasma = {
enable = true; enable = true;
workspace.lookAndFeel = "org.kde.breezedark.desktop"; workspace.lookAndFeel = "org.kde.breezedark.desktop";
@@ -157,8 +227,7 @@ in
]; ];
}; };
# Zen Browser scroll speed — written to all profiles via activation script # ── Zen Browser scroll speed ──────────────────────────────────────────────
# so it works even if the profile ID changes on a fresh install
home.activation.zenBrowserUserJs = lib.hm.dag.entryAfter [ "writeBoundary" ] '' home.activation.zenBrowserUserJs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
for profile in "$HOME/.config/zen/"*.*/; do for profile in "$HOME/.config/zen/"*.*/; do
[[ -d "$profile" ]] || continue [[ -d "$profile" ]] || continue
@@ -166,6 +235,7 @@ in
done done
''; '';
# ── Niri config ───────────────────────────────────────────────────────────
xdg.configFile."niri/config.kdl".source = xdg.configFile."niri/config.kdl".source =
pkgs.runCommand "niri-config-checked" pkgs.runCommand "niri-config-checked"
{ nativeBuildInputs = [ pkgs.niri ]; } { nativeBuildInputs = [ pkgs.niri ]; }