aboutsummaryrefslogtreecommitdiff
path: root/hosts/mantis
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/mantis')
-rw-r--r--hosts/mantis/configuration.nix246
-rw-r--r--hosts/mantis/hardware-configuration.nix16
-rw-r--r--hosts/mantis/home.nix103
-rw-r--r--hosts/mantis/niri-config.kdl470
4 files changed, 639 insertions, 196 deletions
diff --git a/hosts/mantis/configuration.nix b/hosts/mantis/configuration.nix
index 8f71964..d96f321 100644
--- a/hosts/mantis/configuration.nix
+++ b/hosts/mantis/configuration.nix
@@ -1,5 +1,3 @@
1# Edit this configuration file to define what should be installed on
2# your system. Help is available in the configuration.nix(5) man page, on
3# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 1# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
4 2
5{ config, lib, pkgs, self, ... }: 3{ config, lib, pkgs, self, ... }:
@@ -11,217 +9,94 @@
11 ./hardware-configuration.nix 9 ./hardware-configuration.nix
12 ]; 10 ];
13 11
14 nixpkgs.overlays = with self.overlays; [
15 flaresolverr
16 ];
17
18 # Use the systemd-boot EFI boot loader. 12 # Use the systemd-boot EFI boot loader.
19 boot.loader.systemd-boot.enable = true; 13 boot.loader.systemd-boot.enable = true;
20 boot.loader.efi.canTouchEfiVariables = true; 14 boot.loader.efi.canTouchEfiVariables = true;
15 boot.kernelPackages = pkgs.linuxPackages_latest;
16 boot.kernelParams = [ "i915.force_probe=4650" ];
21 17
22 networking.hostName = "mantis"; # Define your hostname. 18 networking.hostName = "mantis";
23 networking.wireless.iwd.enable = true; # Enables wireless support via wpa_supplicant.
24 networking.firewall.allowedTCPPorts = [ 80 443 ];
25
26 time.timeZone = "Europe/London"; 19 time.timeZone = "Europe/London";
27 i18n.defaultLocale = "en_US.UTF-8";
28 20
29 nixpkgs.config.packageOverrides = pkgs: { 21 nixpkgs.overlays = with self.overlays; [
30 vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; }; 22 prompt
31 }; 23 better-text-objs
24 vim-colors-plain
25 ];
32 26
33 # Enable sound. 27 nixpkgs.config = {
34 sound.enable = true; 28 "2bwm".patches = [
35 hardware.pulseaudio.enable = true; 29 ../../patches/2bwm/nerd-patch.diff
36 hardware.opengl = {
37 enable = true;
38 extraPackages = with pkgs; [
39 intel-media-driver
40 vaapiIntel
41 vaapiVdpau
42 libvdpau-va-gl
43 intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
44 ]; 30 ];
31
32 st = {
33 conf = builtins.readFile ../../programs/st/config.h;
34 extraLibs = with pkgs; [ harfbuzz ];
35 patches = [
36 ../../patches/st/xres.diff
37 ../../patches/st/bright.diff
38 ../../patches/st/ligatures.diff
39 ];
40 };
45 }; 41 };
46 42
47 # Define a user account. Don't forget to set a password with ‘passwd’.
48 users.users.op = { 43 users.users.op = {
49 isNormalUser = true; 44 isNormalUser = true;
50 extraGroups = [ "wheel" "tty" ]; 45 extraGroups = [ "wheel" "docker" ];
51 packages = with pkgs; [ ]; 46 packages = with pkgs; [
52 home = "/home/op"; 47 qutebrowser
53 openssh.authorizedKeys.keys = [ 48 tree
54 "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILzFK/zY2ZaAftBfFPO+IJAgyD45pe0fXrpF81p8aNIl np@myrtle"
55 ]; 49 ];
56 }; 50 createHome = true;
57 users.groups."torrent".members = [ 51 home = "/home/op";
58 "op"
59 "sonarr"
60 "radarr"
61 "bazarr"
62 "jackett"
63 "lidarr"
64 "jellyfin"
65 "transmission"
66 ];
67
68 environment.systemPackages = with pkgs; [
69 vim
70 wget
71 pkgs.jellyfin
72 pkgs.jellyfin-web
73 pkgs.jellyfin-ffmpeg
74
75 pkgs.htop
76 pkgs.ripgrep
77 pkgs.git
78 ];
79
80 services.openssh.enable = true;
81 services.nginx.enable = true;
82 services.tailscale.enable = true;
83
84 services.jellyfin = {
85 enable = true;
86 openFirewall = true;
87 group = "torrent";
88 };
89 services.nginx.virtualHosts."stream.mantis" = {
90 listen = [{ port = 80; addr = "0.0.0.0"; }];
91 locations."/" = {
92 proxyPass = "http://127.0.0.1:8096";
93 proxyWebsockets = true;
94 };
95 };
96
97 services.navidrome = {
98 enable = true;
99 openFirewall = true;
100 settings = {
101 MusicFolder = "/servarr/lidarr/";
102 DataFolder = "/etc/navidrome/data";
103 CacheFolder = "/etc/navidrome/cache";
104 Address = "0.0.0.0";
105 Port = 4533;
106 AuthRequestLimit = 0;
107 EnableTranscodingConfig = true;
108 };
109 };
110 services.nginx.virtualHosts."music.mantis" = {
111 listen = [{ port = 80; addr = "0.0.0.0"; }];
112 locations."/" = {
113 proxyPass = "http://127.0.0.1:4533";
114 proxyWebsockets = true;
115 };
116 };
117
118 services.transmission = {
119 enable = true;
120 openFirewall = true;
121 openRPCPort = true;
122 group = "torrent";
123 settings = {
124 download-dir = "/torrents";
125 incomplete-dir = "/.incomplete";
126 rpc-bind-address = "0.0.0.0";
127 rpc-whitelist = "127.0.0.1,10.0.0.1,192.168.*.*,100.64.*.*";
128 };
129 };
130 services.nginx.virtualHosts."torrent.mantis" = {
131 listen = [{ port = 80; addr = "0.0.0.0"; }];
132 locations."/" = {
133 proxyPass = "http://127.0.0.1:9091";
134 };
135 }; 52 };
136 53
137 services.sonarr = { 54 environment = {
138 enable = true; 55 systemPackages = with pkgs; [
139 openFirewall = true; 56 man-pages
140 group = "torrent"; 57 man-pages-posix
141 }; 58 (lib.hiPrio pkgs.bashInteractive)
142 services.nginx.virtualHosts."sonarr.mantis" = { 59 _2bwm
143 listen = [{ port = 80; addr = "0.0.0.0"; }]; 60 ];
144 locations."/" = { 61 variables = {
145 proxyPass = "http://127.0.0.1:8989"; 62 QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor";
63 NIXOS_OZONE_WL = "1";
146 }; 64 };
147 }; 65 };
148 66
149 services.radarr = { 67 services = {
150 enable = true; 68 openssh = {
151 openFirewall = true; 69 enable = true;
152 group = "torrent"; 70 settings = {
153 }; 71 X11Forwarding = true;
154 services.nginx.virtualHosts."radarr.mantis" = { 72 PrintMotd = true;
155 listen = [{ port = 80; addr = "0.0.0.0"; }]; 73 };
156 locations."/" = {
157 proxyPass = "http://127.0.0.1:7878";
158 }; 74 };
159 }; 75 tailscale.enable = true;
160 76 libinput.enable = true;
161 services.bazarr = { 77 xserver = {
162 enable = true; 78 enable = true;
163 openFirewall = true; 79 displayManager.startx.enable = true;
164 group = "torrent";
165 };
166 services.nginx.virtualHosts."bazarr.mantis" = {
167 listen = [{ port = 80; addr = "0.0.0.0"; }];
168 locations."/" = {
169 proxyPass = "http://127.0.0.1:6767";
170 }; 80 };
171 }; 81 };
172 82
173 services.jackett = { 83 hardware.graphics.extraPackages = [
174 enable = true; 84 pkgs.vpl-gpu-rt
175 openFirewall = true; 85 ];
176 group = "torrent";
177 };
178 services.nginx.virtualHosts."jackett.mantis" = {
179 listen = [{ port = 80; addr = "0.0.0.0"; }];
180 locations."/" = {
181 proxyPass = "http://127.0.0.1:9117";
182 };
183 };
184 86
185 services.lidarr = { 87 services.pipewire = {
186 enable = true; 88 enable = true;
187 openFirewall = true; 89 alsa.enable = true;
188 group = "torrent"; 90 alsa.support32Bit = true;
91 pulse.enable = true;
92 jack.enable = true;
189 }; 93 };
190 services.nginx.virtualHosts."lidarr.mantis" = {
191 listen = [{ port = 80; addr = "0.0.0.0"; }];
192 locations."/" = {
193 proxyPass = "http://127.0.0.1:8686";
194 };
195 };
196
197 services.flaresolverr.enable = true;
198 94
199 services.radicale = {
200 enable = true;
201 settings = {
202 server.hosts = [ "0.0.0.0:5232" ];
203 auth = {
204 type = "htpasswd";
205 htpasswd_filename = "/etc/radicale/users";
206 htpasswd_encryption = "bcrypt";
207 };
208 };
209 };
210 services.nginx.virtualHosts."radicale.mantis" = {
211 listen = [{ port = 80; addr = "0.0.0.0"; }];
212 locations."/" = {
213 proxyPass = "http://127.0.0.1:5232";
214 };
215 };
216 95
96 virtualisation.docker.enable = true;
217 97
218 nix.settings.experimental-features = [ "nix-command" "flakes" ]; 98 nix.settings.experimental-features = [ "nix-command" "flakes" ];
219 99
220 # Copy the NixOS configuration file and link it from the resulting system
221 # (/run/current-system/configuration.nix). This is useful in case you
222 # accidentally delete configuration.nix.
223 # system.copySystemConfiguration = true;
224
225 # This option defines the first version of NixOS you have installed on this particular machine, 100 # This option defines the first version of NixOS you have installed on this particular machine,
226 # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. 101 # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
227 # 102 #
@@ -229,7 +104,8 @@
229 # even if you've upgraded your system to a new NixOS release. 104 # even if you've upgraded your system to a new NixOS release.
230 # 105 #
231 # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, 106 # This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
232 # so changing it will NOT upgrade your system. 107 # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
108 # to actually do that.
233 # 109 #
234 # This value being lower than the current NixOS release does NOT mean your system is 110 # This value being lower than the current NixOS release does NOT mean your system is
235 # out of date, out of support, or vulnerable. 111 # out of date, out of support, or vulnerable.
@@ -238,7 +114,7 @@
238 # and migrated your data accordingly. 114 # and migrated your data accordingly.
239 # 115 #
240 # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . 116 # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
241 system.stateVersion = "23.11"; # Did you read the comment? 117 system.stateVersion = "24.05"; # Did you read the comment?
242 118
243} 119}
244 120
diff --git a/hosts/mantis/hardware-configuration.nix b/hosts/mantis/hardware-configuration.nix
index 6afcb08..bebdb21 100644
--- a/hosts/mantis/hardware-configuration.nix
+++ b/hosts/mantis/hardware-configuration.nix
@@ -9,31 +9,26 @@
9 (modulesPath + "/installer/scan/not-detected.nix") 9 (modulesPath + "/installer/scan/not-detected.nix")
10 ]; 10 ];
11 11
12 boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; 12 boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
13 boot.initrd.kernelModules = [ ]; 13 boot.initrd.kernelModules = [ ];
14 boot.kernelModules = [ "kvm-intel" ]; 14 boot.kernelModules = [ "kvm-intel" ];
15 boot.extraModulePackages = [ ]; 15 boot.extraModulePackages = [ ];
16 16
17 fileSystems."/" = 17 fileSystems."/" =
18 { 18 {
19 device = "/dev/disk/by-uuid/e3eda8a2-b5fe-4458-988c-48579a7cc6c6"; 19 device = "/dev/disk/by-uuid/efd94de4-c3fa-4a3b-98f9-66ccfb8479b9";
20 fsType = "ext4";
21 };
22
23 fileSystems."/servarr" =
24 {
25 device = "/dev/sdb";
26 fsType = "ext4"; 20 fsType = "ext4";
27 }; 21 };
28 22
29 fileSystems."/boot" = 23 fileSystems."/boot" =
30 { 24 {
31 device = "/dev/disk/by-uuid/A170-EC57"; 25 device = "/dev/disk/by-uuid/5BBB-E6FE";
32 fsType = "vfat"; 26 fsType = "vfat";
27 options = [ "fmask=0022" "dmask=0022" ];
33 }; 28 };
34 29
35 swapDevices = 30 swapDevices =
36 [{ device = "/dev/disk/by-uuid/61cb6a91-b916-40b9-b231-c04378629d90"; }]; 31 [{ device = "/dev/disk/by-uuid/65faea2e-c2ce-4ec2-8aca-e09e5073676b"; }];
37 32
38 # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 33 # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
39 # (the default) this is the recommended approach. When using systemd-networkd it's 34 # (the default) this is the recommended approach. When using systemd-networkd it's
@@ -41,7 +36,6 @@
41 # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 36 # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
42 networking.useDHCP = lib.mkDefault true; 37 networking.useDHCP = lib.mkDefault true;
43 # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true; 38 # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
44 # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
45 39
46 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 40 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
47 hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; 41 hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
diff --git a/hosts/mantis/home.nix b/hosts/mantis/home.nix
new file mode 100644
index 0000000..dfabeed
--- /dev/null
+++ b/hosts/mantis/home.nix
@@ -0,0 +1,103 @@
1{ config
2, pkgs
3, theme
4, self
5, ...
6}:
7
8{
9
10 imports = [
11 ../../programs
12 ../../services
13 ../../x
14 # ./mail.nix
15 ];
16
17 # programs.niri.enable = false;
18 # programs.niri.config = builtins.readFile ./niri-config.kdl;
19
20 home.stateVersion = "22.11";
21 home.username = "op";
22 home.homeDirectory = "/home/op";
23 home.extraOutputsToInstall = [ "man" ];
24 home.packages = with pkgs; [
25
26 # essentials
27 vim
28 weechat
29 firefox
30 thunderbird
31 qutebrowser
32 unzip
33 tmux
34 ripgrep
35 miniserve
36 pfetch
37 st
38 rxvt-unicode
39 cmus
40 tree
41 w3m
42 noto-fonts-emoji
43 fd
44 du-dust
45 jq
46 libnotify
47 inotify-tools
48 pavucontrol
49 bc
50 killall
51 signal-desktop
52 alsa-utils
53
54 wget
55 curl
56 mosh
57
58 imagemagick
59 ffmpeg-full
60 mpv
61 slop
62 maim
63 arandr
64
65 # monitoring
66 stress
67 powertop
68
69 # input
70 xinput_calibrator
71 libinput
72
73 # wayland stuff
74 xclip
75 # wl-clipboard-rs
76 # swaybg
77
78 nixpkgs-fmt
79
80 ] ++ (import ../../scripts { inherit pkgs; });
81
82 xdg = {
83 userDirs = {
84 enable = true;
85 desktop = "\$HOME/desktop";
86 documents = "\$HOME/docs";
87 download = "\$HOME/dloads";
88 music = "\$HOME/music";
89 pictures = "\$HOME/pics";
90 videos = "\$HOME/vids";
91 };
92 };
93
94 xsession = {
95 enable = true;
96 windowManager.command = "2bwm";
97 initExtra = ''
98 ${pkgs.hsetroot}/bin/hsetroot -solid "${theme.base00}"
99 xrdb -load $HOME/.Xresources
100 '';
101 };
102
103}
diff --git a/hosts/mantis/niri-config.kdl b/hosts/mantis/niri-config.kdl
new file mode 100644
index 0000000..c2641e3
--- /dev/null
+++ b/hosts/mantis/niri-config.kdl
@@ -0,0 +1,470 @@
1// This config is in the KDL format: https://kdl.dev
2// "/-" comments out the following node.
3// Check the wiki for a full description of the configuration:
4// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
5
6// Input device configuration.
7// Find the full list of options on the wiki:
8// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
9input {
10 keyboard {
11 xkb {
12 // You can set rules, model, layout, variant and options.
13 // For more information, see xkeyboard-config(7).
14
15 // For example:
16 // layout "us,ru"
17 // options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
18 }
19 }
20
21 // Next sections include libinput settings.
22 // Omitting settings disables them, or leaves them at their default values.
23 touchpad {
24 // off
25 tap
26 // dwt
27 // dwtp
28 natural-scroll
29 // accel-speed 0.2
30 // accel-profile "flat"
31 // scroll-method "two-finger"
32 // disabled-on-external-mouse
33 }
34
35 mouse {
36 // off
37 // natural-scroll
38 // accel-speed 0.2
39 // accel-profile "flat"
40 // scroll-method "no-scroll"
41 }
42
43 // Uncomment this to make the mouse warp to the center of newly focused windows.
44 warp-mouse-to-focus
45
46 // Focus windows and outputs automatically when moving the mouse into them.
47 // focus-follows-mouse
48}
49
50// You can configure outputs by their name, which you can find
51// by running `niri msg outputs` while inside a niri instance.
52// The built-in laptop monitor is usually called "eDP-1".
53// Find more information on the wiki:
54// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
55// Remember to uncomment the node by removing "/-"!
56output "DP-1" {
57 // Uncomment this line to disable this output.
58 // off
59
60 // Resolution and, optionally, refresh rate of the output.
61 // The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
62 // If the refresh rate is omitted, niri will pick the highest refresh rate
63 // for the resolution.
64 // If the mode is omitted altogether or is invalid, niri will pick one automatically.
65 // Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
66 // mode "[email protected]"
67
68 // You can use integer or fractional scale, for example use 1.5 for 150% scale.
69 // scale 2
70
71 // Transform allows to rotate the output counter-clockwise, valid values are:
72 // normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
73 // transform "270"
74
75 // Position of the output in the global coordinate space.
76 // This affects directional monitor actions like "focus-monitor-left", and cursor movement.
77 // The cursor can only move between directly adjacent outputs.
78 // Output scale and rotation has to be taken into account for positioning:
79 // outputs are sized in logical, or scaled, pixels.
80 // For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
81 // so to put another output directly adjacent to it on the right, set its x to 1920.
82 // If the position is unset or results in an overlap, the output is instead placed
83 // automatically.
84 // position x=1280 y=0
85}
86
87// Settings that influence how windows are positioned and sized.
88// Find more information on the wiki:
89// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
90layout {
91 // Set gaps around windows in logical pixels.
92 gaps 24
93
94 // When to center a column when changing focus, options are:
95 // - "never", default behavior, focusing an off-screen column will keep at the left
96 // or right edge of the screen.
97 // - "always", the focused column will always be centered.
98 // - "on-overflow", focusing a column will center it if it doesn't fit
99 // together with the previously focused column.
100 center-focused-column "never"
101
102 // You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
103 preset-column-widths {
104 // Proportion sets the width as a fraction of the output width, taking gaps into account.
105 // For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
106 // The default preset widths are 1/3, 1/2 and 2/3 of the output.
107 proportion 0.3333
108 proportion 0.6666
109 proportion 1.0
110
111 // Fixed sets the width in logical pixels exactly.
112 // fixed 1920
113 }
114
115 // You can change the default width of the new windows.
116 default-column-width { proportion 0.3333; }
117 // If you leave the brackets empty, the windows themselves will decide their initial width.
118 // default-column-width {}
119
120 // By default focus ring and border are rendered as a solid background rectangle
121 // behind windows. That is, they will show up through semitransparent windows.
122 // This is because windows using client-side decorations can have an arbitrary shape.
123 //
124 // If you don't like that, you should uncomment `prefer-no-csd` below.
125 // Niri will draw focus ring and border *around* windows that agree to omit their
126 // client-side decorations.
127 //
128 // Alternatively, you can override it with a window rule called
129 // `draw-border-with-background`.
130
131 // You can change how the focus ring looks.
132 focus-ring {
133 // Uncomment this line to disable the focus ring.
134 off
135
136 // How many logical pixels the ring extends out from the windows.
137 width 5
138
139 // Colors can be set in a variety of ways:
140 // - CSS named colors: "red"
141 // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
142 // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
143
144 // Color of the ring on the active monitor.
145 active-color "#555555"
146
147 // Color of the ring on inactive monitors.
148 inactive-color "#222"
149
150 // You can also use gradients. They take precedence over solid colors.
151 // Gradients are rendered the same as CSS linear-gradient(angle, from, to).
152 // The angle is the same as in linear-gradient, and is optional,
153 // defaulting to 180 (top-to-bottom gradient).
154 // You can use any CSS linear-gradient tool on the web to set these up.
155 //
156 // active-gradient from="#FF5370" to="#79ffe1" angle=45
157
158 // You can also color the gradient relative to the entire view
159 // of the workspace, rather than relative to just the window itself.
160 // To do that, set relative-to="workspace-view".
161 //
162 // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
163 }
164
165 // You can also add a border. It's similar to the focus ring, but always visible.
166 border {
167 // The settings are the same as for the focus ring.
168 // If you enable the border, you probably want to disable the focus ring.
169 // off
170
171 width 1.5
172 inactive-color "#333333"
173 active-color "#777777"
174
175 // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
176 // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
177 }
178
179 // Struts shrink the area occupied by windows, similarly to layer-shell panels.
180 // You can think of them as a kind of outer gaps. They are set in logical pixels.
181 // Left and right struts will cause the next window to the side to always be visible.
182 // Top and bottom struts will simply add outer gaps in addition to the area occupied by
183 // layer-shell panels and regular gaps.
184 struts {
185 left 24
186 right 24
187 // top 64
188 // bottom 64
189 }
190}
191
192// Add lines like this to spawn processes at startup.
193// Note that running niri as a session supports xdg-desktop-autostart,
194// which may be more convenient to use.
195// See the binds section below for more spawn examples.
196// spawn-at-startup "alacritty" "-e" "fish"
197spawn-at-startup "swaybg" "-i" "/home/op/dloads/leaves3.png" "-m" "tile"
198spawn-at-startup "dunst"
199
200// Uncomment this line to ask the clients to omit their client-side decorations if possible.
201// If the client will specifically ask for CSD, the request will be honored.
202// Additionally, clients will be informed that they are tiled, removing some rounded corners.
203// prefer-no-csd
204
205// You can change the path where screenshots are saved.
206// A ~ at the front will be expanded to the home directory.
207// The path is formatted with strftime(3) to give you the screenshot date and time.
208screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
209
210// You can also set this to null to disable saving screenshots to disk.
211// screenshot-path null
212
213// Animation settings.
214// The wiki explains how to configure individual animations:
215// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
216animations {
217 // Uncomment to turn off all animations.
218 // off
219
220 // Slow down all animations by this factor. Values below 1 speed them up instead.
221 // slowdown 3.0
222}
223
224// Window rules let you adjust behavior for individual windows.
225// Find more information on the wiki:
226// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
227
228// Work around WezTerm's initial configure bug
229// by setting an empty default-column-width.
230window-rule {
231 // This regular expression is intentionally made as specific as possible,
232 // since this is the default config, and we want no false positives.
233 // You can get away with just app-id="wezterm" if you want.
234 match app-id=r#"^org\.wezfurlong\.wezterm$"#
235 default-column-width {}
236}
237
238// Example: block out two password managers from screen capture.
239// (This example rule is commented out with a "/-" in front.)
240/-window-rule {
241 match app-id=r#"^org\.keepassxc\.KeePassXC$"#
242 match app-id=r#"^org\.gnome\.World\.Secrets$"#
243
244 block-out-from "screen-capture"
245
246 // Use this instead if you want them visible on third-party screenshot tools.
247 // block-out-from "screencast"
248}
249
250binds {
251 // Keys consist of modifiers separated by + signs, followed by an XKB key name
252 // in the end. To find an XKB name for a particular key, you may use a program
253 // like wev.
254 //
255 // "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
256 // when running as a winit window.
257 //
258 // Most actions that you can bind here can also be invoked programmatically with
259 // `niri msg action do-something`.
260
261 // Mod-Shift-/, which is usually the same as Mod-?,
262 // shows a list of important hotkeys.
263 Mod+Shift+Slash { show-hotkey-overlay; }
264
265 // Suggested binds for running programs: terminal, app launcher, screen locker.
266 Mod+Return { spawn "alacritty"; }
267 Mod+D { spawn "rofi" "-show" "combi"; }
268 Super+Alt+L { spawn "swaylock"; }
269
270 // You can also use a shell. Do this if you need pipes, multiple commands, etc.
271 // Note: the entire command goes as a single argument in the end.
272 // Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
273
274 // Example volume keys mappings for PipeWire & WirePlumber.
275 // The allow-when-locked=true property makes them work even when the session is locked.
276 XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
277 XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
278 XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
279 XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
280
281 Mod+Q { close-window; }
282
283 Mod+Left { focus-column-left; }
284 Mod+Down { focus-window-down; }
285 Mod+Up { focus-window-up; }
286 Mod+Right { focus-column-right; }
287 Mod+H { focus-column-left; }
288 Mod+N { focus-window-down; }
289 Mod+E { focus-window-up; }
290 Mod+I { focus-column-right; }
291
292 Mod+Shift+H { move-column-left; }
293 Mod+Shift+N { move-window-down; }
294 Mod+Shift+E { move-window-up; }
295 Mod+Shift+I { move-column-right; }
296 Mod+Ctrl+Shift+H { consume-or-expel-window-left; }
297 Mod+Ctrl+Shift+I { consume-or-expel-window-right; }
298 // Mod+Ctrl+H { move-column-left; }
299 // Mod+Ctrl+N { move-window-down; }
300 // Mod+Ctrl+E { move-window-up; }
301 // Mod+Ctrl+I { move-column-right; }
302
303 // Alternative commands that move across workspaces when reaching
304 // the first or last window in a column.
305 // Mod+J { focus-window-or-workspace-down; }
306 // Mod+K { focus-window-or-workspace-up; }
307 // Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
308 // Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
309
310 Mod+Shift+6 { focus-column-first; }
311 Mod+Shift+4 { focus-column-last; }
312 Mod+Ctrl+Home { move-column-to-first; }
313 Mod+Ctrl+End { move-column-to-last; }
314
315 // Mod+Shift+Left { focus-monitor-left; }
316 // Mod+Shift+Down { focus-monitor-down; }
317 // Mod+Shift+Up { focus-monitor-up; }
318 // Mod+Shift+Right { focus-monitor-right; }
319 // Mod+Shift+H { focus-monitor-left; }
320 // Mod+Shift+J { focus-monitor-down; }
321 // Mod+Shift+K { focus-monitor-up; }
322 // Mod+Shift+L { focus-monitor-right; }
323
324 // Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
325 // Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
326 // Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
327 // Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
328 // Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
329 // Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
330 // Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
331 // Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
332
333 // Alternatively, there are commands to move just a single window:
334 // Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
335 // ...
336
337 // And you can also move a whole workspace to another monitor:
338 // Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
339 // ...
340
341 // Mod+Page_Down { focus-workspace-down; }
342 // Mod+Page_Up { focus-workspace-up; }
343 // Mod+U { focus-workspace-down; }
344 // Mod+I { focus-workspace-up; }
345 // Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
346 // Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
347 // Mod+Ctrl+U { move-column-to-workspace-down; }
348 // Mod+Ctrl+I { move-column-to-workspace-up; }
349
350 // Alternatively, there are commands to move just a single window:
351 // Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
352 // ...
353
354 // Mod+Shift+Page_Down { move-workspace-down; }
355 // Mod+Shift+Page_Up { move-workspace-up; }
356 // Mod+Shift+U { move-workspace-down; }
357 // Mod+Shift+I { move-workspace-up; }
358
359 // You can bind mouse wheel scroll ticks using the following syntax.
360 // These binds will change direction based on the natural-scroll setting.
361 //
362 // To avoid scrolling through workspaces really fast, you can use
363 // the cooldown-ms property. The bind will be rate-limited to this value.
364 // You can set a cooldown on any bind, but it's most useful for the wheel.
365 Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
366 Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
367 Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
368 Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
369
370 Mod+WheelScrollRight { focus-column-right; }
371 Mod+WheelScrollLeft { focus-column-left; }
372 Mod+Ctrl+WheelScrollRight { move-column-right; }
373 Mod+Ctrl+WheelScrollLeft { move-column-left; }
374
375 // Usually scrolling up and down with Shift in applications results in
376 // horizontal scrolling; these binds replicate that.
377 Mod+Shift+WheelScrollDown { focus-column-right; }
378 Mod+Shift+WheelScrollUp { focus-column-left; }
379 Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
380 Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
381
382 // Similarly, you can bind touchpad scroll "ticks".
383 // Touchpad scrolling is continuous, so for these binds it is split into
384 // discrete intervals.
385 // These binds are also affected by touchpad's natural-scroll, so these
386 // example binds are "inverted", since we have natural-scroll enabled for
387 // touchpads by default.
388 // Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
389 // Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
390
391 // You can refer to workspaces by index. However, keep in mind that
392 // niri is a dynamic workspace system, so these commands are kind of
393 // "best effort". Trying to refer to a workspace index bigger than
394 // the current workspace count will instead refer to the bottommost
395 // (empty) workspace.
396 //
397 // For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
398 // will all refer to the 3rd workspace.
399 Mod+1 { focus-workspace 1; }
400 Mod+2 { focus-workspace 2; }
401 Mod+3 { focus-workspace 3; }
402 Mod+4 { focus-workspace 4; }
403 Mod+5 { focus-workspace 5; }
404 Mod+6 { focus-workspace 6; }
405 Mod+7 { focus-workspace 7; }
406 Mod+8 { focus-workspace 8; }
407 Mod+9 { focus-workspace 9; }
408 Mod+Ctrl+1 { move-column-to-workspace 1; }
409 Mod+Ctrl+2 { move-column-to-workspace 2; }
410 Mod+Ctrl+3 { move-column-to-workspace 3; }
411 Mod+Ctrl+4 { move-column-to-workspace 4; }
412 Mod+Ctrl+5 { move-column-to-workspace 5; }
413 Mod+Ctrl+6 { move-column-to-workspace 6; }
414 Mod+Ctrl+7 { move-column-to-workspace 7; }
415 Mod+Ctrl+8 { move-column-to-workspace 8; }
416 Mod+Ctrl+9 { move-column-to-workspace 9; }
417
418 // Alternatively, there are commands to move just a single window:
419 // Mod+Ctrl+1 { move-window-to-workspace 1; }
420
421 // Switches focus between the current and the previous workspace.
422 // Mod+Tab { focus-workspace-previous; }
423
424 Mod+Comma { consume-window-into-column; }
425 Mod+Period { expel-window-from-column; }
426
427 // There are also commands that consume or expel a single window to the side.
428 // Mod+BracketLeft { consume-or-expel-window-left; }
429 // Mod+BracketRight { consume-or-expel-window-right; }
430
431 Mod+R { switch-preset-column-width; }
432 Mod+Shift+R { reset-window-height; }
433 Mod+F { maximize-column; }
434 Mod+Shift+F { fullscreen-window; }
435 Mod+C { center-column; }
436
437 // Finer width adjustments.
438 // This command can also:
439 // * set width in pixels: "1000"
440 // * adjust width in pixels: "-5" or "+5"
441 // * set width as a percentage of screen width: "25%"
442 // * adjust width as a percentage of screen width: "-10%" or "+10%"
443 // Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
444 // set-column-width "100" will make the column occupy 200 physical screen pixels.
445 Mod+G { set-column-width "+33.333%"; }
446 Mod+Shift+G { set-column-width "-33.333%"; }
447
448 // Finer height adjustments when in column with other windows.
449 Mod+Shift+Minus { set-window-height "-10%"; }
450 Mod+Shift+Equal { set-window-height "+10%"; }
451
452 // Actions to switch layouts.
453 // Note: if you uncomment these, make sure you do NOT have
454 // a matching layout switch hotkey configured in xkb options above.
455 // Having both at once on the same hotkey will break the switching,
456 // since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
457 // Mod+Space { switch-layout "next"; }
458 // Mod+Shift+Space { switch-layout "prev"; }
459
460 Print { screenshot; }
461 Ctrl+Print { screenshot-screen; }
462 Alt+Print { screenshot-window; }
463
464 // The quit action will show a confirmation dialog to avoid accidental exits.
465 Mod+Shift+Q { quit; }
466
467 // Powers off the monitors. To turn them back on, do any input like
468 // moving the mouse or pressing any other key.
469 Mod+Shift+P { power-off-monitors; }
470}