nixos/modules/features/tiling/niri.nix

306 lines
10 KiB
Nix
Raw Normal View History

2026-05-19 00:37:42 +00:00
{ self, inputs, ... }: {
perSystem = { pkgs, lib, self', ... }: {
packages.myNiri = inputs.wrapper-modules.wrappers.niri.wrap {
2026-05-19 01:08:18 +00:00
inherit pkgs;
2026-05-19 00:37:42 +00:00
settings = {
2026-05-19 20:43:22 +00:00
prefer-no-csd = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
spawn-sh-at-startup = [
"ckb-next -b"
(lib.getExe self'.packages.myNoctalia)
2026-05-22 22:12:51 +00:00
# Wallpapers
"${pkgs.mpvpaper}/bin/mpvpaper -n 900 -o '--hwdec=auto --no-audio --loop-playlist shuffle --panscan=1.0 --scale=nearest' ALL ${./wallpapers}"
2026-05-19 00:37:42 +00:00
];
screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png";
layout = {
gaps = 5;
center-focused-column = "never";
default-column-width = {
proportion = 0.5;
};
focus-ring = {
width = 1.5;
active-color = "#7aa2f7";
inactive-color = "#a9b1d6";
};
border = {
2026-05-19 20:43:22 +00:00
off = {};
2026-05-19 00:37:42 +00:00
width = 4;
active-color = "#ffc87f";
inactive-color = "#505050";
urgent-color = "#9b0000";
};
};
2026-05-19 20:43:22 +00:00
outputs = {
2026-05-19 00:37:42 +00:00
"HDMI-A-1" = {
mode = "1920x1080@60.00";
2026-05-19 20:43:22 +00:00
position = _: {
props = {
x = 0;
y = 180;
};
};
2026-05-19 00:37:42 +00:00
};
"DP-2" = {
mode = "2560x1440@144.00";
2026-05-19 20:43:22 +00:00
position = _: {
props = {
x = 1920;
y = 0;
};
};
variable-refresh-rate = {};
2026-05-19 00:37:42 +00:00
};
"DP-1" = {
mode = "1680x1050@60.00";
2026-05-19 20:43:22 +00:00
position = _: {
props = {
x = 4480;
y = 195;
};
};
2026-05-19 00:37:42 +00:00
};
};
input = {
keyboard = {
2026-05-19 20:43:22 +00:00
numlock = {};
2026-05-19 00:37:42 +00:00
repeat-rate = 35;
repeat-delay = 500;
};
touchpad = {
2026-05-19 20:43:22 +00:00
tap = {};
natural-scroll = {};
2026-06-09 11:23:51 -04:00
scroll-factor = 0.25;
2026-05-19 00:37:42 +00:00
};
2026-05-19 20:43:22 +00:00
focus-follows-mouse = {};
2026-05-19 00:37:42 +00:00
};
window-rules = [
{
matches = [ { app-id = "^brave-browser$"; title = "^Picture-in-Picture$"; } ];
open-floating = true;
}
{
matches = [
{ app-id = "^org\\.keepassxc\\.KeePassXC$"; }
{ app-id = "^org\\.gnome\\.World\\.Secrets$"; }
];
block-out-from = "screen-capture";
}
{
2026-05-19 20:43:22 +00:00
geometry-corner-radius = 12;
2026-05-19 00:37:42 +00:00
clip-to-geometry = true;
}
{
matches = [ { app-id = "^brave-browser$"; } ];
open-maximized = true;
}
{
matches = [ { app-id = "^vesktop$"; } ];
open-maximized = true;
}
{
matches = [ { app-id = "^steam$"; } ];
open-maximized = true;
}
2026-05-22 22:04:09 -04:00
{
matches = [ { app-id = "^vesktop$"; } ];
background-effect = {
blur = true;
xray = false;
};
}
2026-05-19 00:37:42 +00:00
];
binds = {
2026-05-19 20:43:22 +00:00
"Mod+Shift+Slash".show-hotkey-overlay = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+T".spawn = "alacritty";
"Mod+D".spawn = "fuzzel";
"Super+Ctrl+L".spawn = "swaylock";
"Super+Alt+S".spawn = [ "sh" "-c" "pkill orca || exec orca" ];
2026-05-19 00:37:42 +00:00
# Media & Volume Controls
2026-05-19 20:43:22 +00:00
"XF86AudioRaiseVolume".spawn = [ "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0" ];
"XF86AudioLowerVolume".spawn = [ "sh" "-c" "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-" ];
"XF86AudioMute".spawn = [ "sh" "-c" "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" ];
"XF86AudioMicMute".spawn = [ "sh" "-c" "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" ];
"XF86AudioPlay".spawn = [ "sh" "-c" "playerctl play-pause" ];
"XF86AudioStop".spawn = [ "sh" "-c" "playerctl stop" ];
"XF86AudioPrev".spawn = [ "sh" "-c" "playerctl previous" ];
"XF86AudioNext".spawn = [ "sh" "-c" "playerctl next" ];
2026-05-19 00:37:42 +00:00
# Brightness Controls
2026-05-19 20:43:22 +00:00
"XF86MonBrightnessUp".spawn = [ "brightnessctl" "--class=backlight" "set" "+10%" ];
"XF86MonBrightnessDown".spawn = [ "brightnessctl" "--class=backlight" "set" "10%-" ];
2026-05-19 00:37:42 +00:00
# Window & Layout Navigation
2026-05-19 20:43:22 +00:00
"Mod+O".toggle-overview = {};
"Mod+Q".close-window = {};
"Mod+Left".focus-column-left = {};
"Mod+Down".focus-window-down = {};
"Mod+Up".focus-window-up = {};
"Mod+Right".focus-column-right = {};
"Mod+H".focus-column-left = {};
"Mod+J".focus-window-down = {};
"Mod+K".focus-window-up = {};
"Mod+L".focus-column-right = {};
"Mod+Ctrl+Left".move-column-left = {};
"Mod+Ctrl+Down".move-window-down = {};
"Mod+Ctrl+Up".move-window-up = {};
"Mod+Ctrl+Right".move-column-right = {};
"Mod+Ctrl+H".move-column-left = {};
"Mod+Ctrl+J".move-window-down = {};
"Mod+Ctrl+K".move-window-up = {};
"Mod+Ctrl+L".move-column-right = {};
"Mod+Home".focus-column-first = {};
"Mod+End".focus-column-last = {};
"Mod+Ctrl+Home".move-column-to-first = {};
"Mod+Ctrl+End".move-column-to-last = {};
2026-05-19 00:37:42 +00:00
# Monitor Navigation
2026-05-19 20:43:22 +00:00
"Mod+Shift+Left".focus-monitor-left = {};
"Mod+Shift+Down".focus-monitor-down = {};
"Mod+Shift+Up".focus-monitor-up = {};
"Mod+Shift+Right".focus-monitor-right = {};
"Mod+Shift+H".focus-monitor-left = {};
"Mod+Shift+J".focus-monitor-down = {};
"Mod+Shift+K".focus-monitor-up = {};
"Mod+Shift+L".focus-monitor-right = {};
"Mod+Shift+Ctrl+Left".move-column-to-monitor-left = {};
"Mod+Shift+Ctrl+Down".move-column-to-monitor-down = {};
"Mod+Shift+Ctrl+Up".move-column-to-monitor-up = {};
"Mod+Shift+Ctrl+Right".move-column-to-monitor-right = {};
"Mod+Shift+Ctrl+H".move-column-to-monitor-left = {};
"Mod+Shift+Ctrl+J".move-column-to-monitor-down = {};
"Mod+Shift+Ctrl+K".move-column-to-monitor-up = {};
"Mod+Shift+Ctrl+L".move-column-to-monitor-right = {};
2026-05-19 00:37:42 +00:00
# Workspace Navigation
2026-05-19 20:43:22 +00:00
"Mod+Page_Down".focus-workspace-down = {};
"Mod+Page_Up".focus-workspace-up = {};
"Mod+U".focus-workspace-down = {};
"Mod+I".focus-workspace-up = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+Ctrl+Page_Down".move-column-to-workspace-down = {};
"Mod+Ctrl+Page_Up".move-column-to-workspace-up = {};
"Mod+Ctrl+U".move-column-to-workspace-down = {};
"Mod+Ctrl+I".move-column-to-workspace-up = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+Shift+Page_Down".move-workspace-down = {};
"Mod+Shift+Page_Up".move-workspace-up = {};
"Mod+Shift+U".move-workspace-down = {};
"Mod+Shift+I".move-workspace-up = {};
2026-05-19 00:37:42 +00:00
# Scrolling / Mouse Wheel
2026-05-19 20:43:22 +00:00
"Mod+WheelScrollDown".focus-workspace-down = {};
"Mod+WheelScrollUp".focus-workspace-up = {};
"Mod+Ctrl+WheelScrollDown".move-column-to-workspace-down = {};
"Mod+Ctrl+WheelScrollUp".move-column-to-workspace-up = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+WheelScrollRight".focus-column-right = {};
"Mod+WheelScrollLeft".focus-column-left = {};
"Mod+Ctrl+WheelScrollRight".move-column-right = {};
"Mod+Ctrl+WheelScrollLeft".move-column-left = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+Shift+WheelScrollDown".focus-column-right = {};
"Mod+Shift+WheelScrollUp".focus-column-left = {};
"Mod+Ctrl+Shift+WheelScrollDown".move-column-right = {};
"Mod+Ctrl+Shift+WheelScrollUp".move-column-left = {};
2026-05-19 00:37:42 +00:00
# Numbered Workspaces
2026-05-19 20:43:22 +00:00
"Mod+1".focus-workspace = 1;
"Mod+2".focus-workspace = 2;
"Mod+3".focus-workspace = 3;
"Mod+4".focus-workspace = 4;
"Mod+5".focus-workspace = 5;
"Mod+6".focus-workspace = 6;
"Mod+7".focus-workspace = 7;
"Mod+8".focus-workspace = 8;
"Mod+9".focus-workspace = 9;
"Mod+Ctrl+1".move-column-to-workspace = 1;
"Mod+Ctrl+2".move-column-to-workspace = 2;
"Mod+Ctrl+3".move-column-to-workspace = 3;
"Mod+Ctrl+4".move-column-to-workspace = 4;
"Mod+Ctrl+5".move-column-to-workspace = 5;
"Mod+Ctrl+6".move-column-to-workspace = 6;
"Mod+Ctrl+7".move-column-to-workspace = 7;
"Mod+Ctrl+8".move-column-to-workspace = 8;
"Mod+Ctrl+9".move-column-to-workspace = 9;
2026-05-19 00:37:42 +00:00
# Window Layout Adjustments
2026-05-19 20:43:22 +00:00
"Mod+BracketLeft".consume-or-expel-window-left = {};
"Mod+BracketRight".consume-or-expel-window-right = {};
"Mod+Comma".consume-window-into-column = {};
"Mod+Period".expel-window-from-column = {};
2026-05-19 00:37:42 +00:00
2026-05-19 20:43:22 +00:00
"Mod+R".switch-preset-column-width = {};
"Mod+Shift+R".switch-preset-window-height = {};
"Mod+Ctrl+R".reset-window-height = {};
"Mod+F".maximize-column = {};
"Mod+Shift+F".fullscreen-window = {};
"Mod+Ctrl+F".expand-column-to-available-width = {};
"Mod+C".center-column = {};
"Mod+Ctrl+C".center-visible-columns = {};
"Mod+Minus".set-column-width = "-10%";
"Mod+Equal".set-column-width = "+10%";
"Mod+Shift+Minus".set-window-height = "-10%";
"Mod+Shift+Equal".set-window-height = "+10%";
"Mod+V".toggle-window-floating = {};
"Mod+Shift+V".switch-focus-between-floating-and-tiling = {};
"Mod+W".toggle-column-tabbed-display = {};
2026-05-19 00:37:42 +00:00
# Screenshots
2026-05-19 20:43:22 +00:00
"Print".screenshot = {};
"Ctrl+Print".screenshot-screen = {};
"Alt+Print".screenshot-window = {};
2026-05-19 00:37:42 +00:00
# System Controls
2026-05-19 20:43:22 +00:00
"Mod+Escape".toggle-keyboard-shortcuts-inhibit = {};
"Mod+Shift+E".quit = {};
"Ctrl+Alt+Delete".quit = {};
"Mod+Shift+P".power-off-monitors = {};
2026-05-19 00:37:42 +00:00
};
};
};
};
flake.nixosModules.niri = { pkgs, lib, ... }: {
programs.niri = {
enable = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri;
};
security.polkit.enable = true;
services.gnome.gnome-keyring.enable = true;
environment.systemPackages = with pkgs; [
xwayland-satellite
2026-05-22 22:12:51 +00:00
mpvpaper
];
};
2026-05-19 00:37:42 +00:00
}