my nix flake.

feat(dahlia,user): niri

vt3e.cat 30e7eddf 290de848

verified
+359
+108
flake.lock
··· 58 58 "type": "github" 59 59 } 60 60 }, 61 + "niri": { 62 + "inputs": { 63 + "niri-stable": "niri-stable", 64 + "niri-unstable": "niri-unstable", 65 + "nixpkgs": [ 66 + "nixpkgs" 67 + ], 68 + "nixpkgs-stable": "nixpkgs-stable", 69 + "xwayland-satellite-stable": "xwayland-satellite-stable", 70 + "xwayland-satellite-unstable": "xwayland-satellite-unstable" 71 + }, 72 + "locked": { 73 + "lastModified": 1754797984, 74 + "narHash": "sha256-t2WFkdB2qUyZt5rdqmJ340kqhvQWWOCJBJIc1nQ/Hg4=", 75 + "owner": "sodiboo", 76 + "repo": "niri-flake", 77 + "rev": "647a310f1eaa59abec8aa215ff69d8979195425e", 78 + "type": "github" 79 + }, 80 + "original": { 81 + "owner": "sodiboo", 82 + "repo": "niri-flake", 83 + "type": "github" 84 + } 85 + }, 86 + "niri-stable": { 87 + "flake": false, 88 + "locked": { 89 + "lastModified": 1748151941, 90 + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", 91 + "owner": "YaLTeR", 92 + "repo": "niri", 93 + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", 94 + "type": "github" 95 + }, 96 + "original": { 97 + "owner": "YaLTeR", 98 + "ref": "v25.05.1", 99 + "repo": "niri", 100 + "type": "github" 101 + } 102 + }, 103 + "niri-unstable": { 104 + "flake": false, 105 + "locked": { 106 + "lastModified": 1754742008, 107 + "narHash": "sha256-Tp0FG7VpLudVEC622d91z2hbdfPLCXxw0Nv43iNN4O0=", 108 + "owner": "YaLTeR", 109 + "repo": "niri", 110 + "rev": "67361f88fd01974ebee4cf80f0e29c87d805cc39", 111 + "type": "github" 112 + }, 113 + "original": { 114 + "owner": "YaLTeR", 115 + "repo": "niri", 116 + "type": "github" 117 + } 118 + }, 61 119 "nixos-hardware": { 62 120 "locked": { 63 121 "lastModified": 1750431636, ··· 105 163 "type": "github" 106 164 } 107 165 }, 166 + "nixpkgs-stable": { 167 + "locked": { 168 + "lastModified": 1754689972, 169 + "narHash": "sha256-eogqv6FqZXHgqrbZzHnq43GalnRbLTkbBbFtEfm1RSc=", 170 + "owner": "NixOS", 171 + "repo": "nixpkgs", 172 + "rev": "fc756aa6f5d3e2e5666efcf865d190701fef150a", 173 + "type": "github" 174 + }, 175 + "original": { 176 + "owner": "NixOS", 177 + "ref": "nixos-25.05", 178 + "repo": "nixpkgs", 179 + "type": "github" 180 + } 181 + }, 108 182 "root": { 109 183 "inputs": { 110 184 "catppuccin": "catppuccin", 111 185 "flake-parts": "flake-parts", 112 186 "home-manager": "home-manager", 187 + "niri": "niri", 113 188 "nixos-hardware": "nixos-hardware", 114 189 "nixpkgs": "nixpkgs", 115 190 "spicetify-nix": "spicetify-nix" ··· 148 223 "original": { 149 224 "owner": "nix-systems", 150 225 "repo": "default", 226 + "type": "github" 227 + } 228 + }, 229 + "xwayland-satellite-stable": { 230 + "flake": false, 231 + "locked": { 232 + "lastModified": 1748488455, 233 + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", 234 + "owner": "Supreeeme", 235 + "repo": "xwayland-satellite", 236 + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", 237 + "type": "github" 238 + }, 239 + "original": { 240 + "owner": "Supreeeme", 241 + "ref": "v0.6", 242 + "repo": "xwayland-satellite", 243 + "type": "github" 244 + } 245 + }, 246 + "xwayland-satellite-unstable": { 247 + "flake": false, 248 + "locked": { 249 + "lastModified": 1754533920, 250 + "narHash": "sha256-fCZ68Yud1sUCq6UNXj0SDyiBgVA8gJUE+14ZFGsFJG8=", 251 + "owner": "Supreeeme", 252 + "repo": "xwayland-satellite", 253 + "rev": "e0d1dad25a158551ab58547b2ece4b7d5a19929c", 254 + "type": "github" 255 + }, 256 + "original": { 257 + "owner": "Supreeeme", 258 + "repo": "xwayland-satellite", 151 259 "type": "github" 152 260 } 153 261 }
+5
flake.nix
··· 24 24 url = "github:catppuccin/nix"; 25 25 inputs.nixpkgs.follows = "nixpkgs"; 26 26 }; 27 + 28 + niri = { 29 + url = "github:sodiboo/niri-flake"; 30 + inputs.nixpkgs.follows = "nixpkgs"; 31 + }; 27 32 }; 28 33 29 34 outputs =
+3
hosts/dahlia/default.nix
··· 1 1 { 2 + inputs, 2 3 pkgs, 3 4 ... 4 5 }: ··· 14 15 ./mounts.nix 15 16 ]; 16 17 18 + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; 17 19 time.timeZone = "Europe/London"; 18 20 users.users.willow = { 19 21 isNormalUser = true; ··· 32 34 libsForQt5.polkit-kde-agent 33 35 wlroots 34 36 wl-clipboard 37 + xwayland-satellite 35 38 ]; 36 39 37 40 hardware.enableRedistributableFirmware = true;
+1
hosts/default.nix
··· 7 7 ./dahlia 8 8 ./dahlia/_hware-config.nix 9 9 inputs.home-manager.nixosModules.home-manager 10 + inputs.niri.nixosModules.niri 10 11 ]; 11 12 specialArgs = { 12 13 inherit inputs;
+1
user/desktop/default.nix
··· 2 2 imports = [ 3 3 ./sway 4 4 ./waybar 5 + ./niri 5 6 ./rofi.nix 6 7 ]; 7 8 }
+241
user/desktop/niri/default.nix
··· 1 + { 2 + pkgs, 3 + config, 4 + lib, 5 + ... 6 + }: 7 + let 8 + flavor = config.catppuccin.flavor; 9 + palette = config.palette.${flavor}; 10 + 11 + colour = name: palette.colors.${name}.hex; 12 + 13 + cActive = colour "blue"; 14 + cInactive = colour "surface0"; 15 + 16 + workspaceOutputs = lib.genAttrs (map toString (lib.range 1 9)) ( 17 + i: 18 + if 19 + lib.elem (lib.toInt i) [ 20 + 1 21 + 3 22 + 5 23 + 7 24 + 9 25 + ] 26 + then 27 + "DP-1" 28 + else 29 + "HDMI-A-1" 30 + ); 31 + 32 + in 33 + { 34 + 35 + programs.niri = { 36 + 37 + settings = { 38 + prefer-no-csd = true; 39 + 40 + overview = { 41 + backdrop-color = colour "mantle"; 42 + }; 43 + 44 + input = { 45 + focus-follows-mouse = { 46 + enable = true; 47 + max-scroll-amount = "50%"; 48 + }; 49 + keyboard.xkb.layout = "gb"; 50 + }; 51 + environment = { 52 + NIXOS_OZONE_WL = "1"; 53 + DISPLAY = ":0"; 54 + }; 55 + 56 + workspaces = lib.mapAttrs (ws: out: { "open-on-output" = out; }) workspaceOutputs; 57 + 58 + spawn-at-startup = [ 59 + { 60 + command = [ 61 + "sh -c 'systemctl --user import-environment PATH; systemctl --user restart xdg-desktop-portal.service'" 62 + ]; 63 + } 64 + { command = [ "${pkgs.xwayland-satellite}/bin/xwayland-satellite" ]; } 65 + { command = [ "swww-daemon" ]; } 66 + { command = [ "_wallpaper" ]; } 67 + { command = [ "firefox" ]; } 68 + { command = [ "vesktop" ]; } 69 + { command = [ "thunderbird" ]; } 70 + { command = [ "foot" ]; } 71 + { command = [ "tidal-hifi" ]; } 72 + { command = [ "zeditor" ]; } 73 + { command = [ "keepassxc" ]; } 74 + { 75 + command = [ 76 + "sh -c 'systemctl --user reset-failed waybar.service || true; systemctl --user start waybar.service'" 77 + ]; 78 + } 79 + ]; 80 + 81 + layout = { 82 + gaps = 4; 83 + border = { 84 + enable = true; 85 + width = 1; 86 + active.color = cActive; 87 + inactive.color = cInactive; 88 + }; 89 + focus-ring.enable = false; 90 + shadow.enable = true; 91 + always-center-single-column = true; 92 + }; 93 + 94 + outputs."DP-1" = { 95 + position = { 96 + x = 0; 97 + y = 0; 98 + }; 99 + focus-at-startup = true; 100 + }; 101 + outputs."HDMI-A-1" = { 102 + position = { 103 + x = 1920; 104 + y = 0; 105 + }; 106 + }; 107 + 108 + binds = { 109 + "Mod+T".action.spawn = "foot"; 110 + "Mod+D".action.spawn = [ 111 + "${pkgs.rofi-wayland}/bin/rofi" 112 + "-show" 113 + "drun" 114 + ]; 115 + "Mod+Tab".action.toggle-overview = { }; 116 + 117 + "Mod+Shift+D".action.screenshot = { 118 + show-pointer = true; 119 + }; 120 + "Mod+Ctrl+D".action.screenshot-window = { }; 121 + 122 + "Mod+Shift+E".action.close-window = { }; 123 + "Mod+F".action.fullscreen-window = { }; 124 + "Mod+Shift+F".action.toggle-windowed-fullscreen = { }; 125 + "Mod+Space".action.toggle-window-floating = { }; 126 + 127 + "Mod+Q".action.focus-column-or-monitor-left = { }; 128 + "Mod+W".action.focus-column-or-monitor-right = { }; 129 + "Mod+A".action.focus-window-or-workspace-up = { }; 130 + "Mod+S".action.focus-window-or-workspace-down = { }; 131 + 132 + "Mod+Shift+Q".action.move-column-left-or-to-monitor-left = { }; 133 + "Mod+Shift+W".action.move-column-right-or-to-monitor-right = { }; 134 + "Mod+Shift+A".action.move-window-up-or-to-workspace-up = { }; 135 + "Mod+Shift+S".action.move-window-down-or-to-workspace-down = { }; 136 + 137 + "Mod+R".action.toggle-column-tabbed-display = { }; 138 + 139 + "Mod+C".action.center-column = { }; 140 + "Mod+Minus".action.set-column-width = "-10%"; 141 + "Mod+Equal".action.set-column-width = "+10%"; 142 + "Mod+M".action.maximize-column = { }; 143 + 144 + "Mod+1".action.focus-workspace = "1"; 145 + "Mod+2".action.focus-workspace = "2"; 146 + "Mod+3".action.focus-workspace = "3"; 147 + "Mod+4".action.focus-workspace = "4"; 148 + "Mod+5".action.focus-workspace = "5"; 149 + "Mod+6".action.focus-workspace = "6"; 150 + "Mod+7".action.focus-workspace = "7"; 151 + "Mod+8".action.focus-workspace = "8"; 152 + "Mod+9".action.focus-workspace = "9"; 153 + 154 + "Mod+Shift+1".action.move-window-to-workspace = "1"; 155 + "Mod+Shift+2".action.move-window-to-workspace = "2"; 156 + "Mod+Shift+3".action.move-window-to-workspace = "3"; 157 + "Mod+Shift+4".action.move-window-to-workspace = "4"; 158 + "Mod+Shift+5".action.move-window-to-workspace = "5"; 159 + "Mod+Shift+6".action.move-window-to-workspace = "6"; 160 + "Mod+Shift+7".action.move-window-to-workspace = "7"; 161 + "Mod+Shift+8".action.move-window-to-workspace = "8"; 162 + "Mod+Shift+9".action.move-window-to-workspace = "9"; 163 + 164 + "XF86AudioPlay".action.spawn = [ 165 + "playerctl" 166 + "play-pause" 167 + ]; 168 + "XF86AudioNext".action.spawn = [ 169 + "playerctl" 170 + "next" 171 + ]; 172 + "XF86AudioPrev".action.spawn = [ 173 + "playerctl" 174 + "previous" 175 + ]; 176 + "XF86AudioRaiseVolume".action.spawn = [ 177 + "pactl" 178 + "set-sink-volume" 179 + "@DEFAULT_SINK@" 180 + "+5%" 181 + ]; 182 + "XF86AudioLowerVolume".action.spawn = [ 183 + "pactl" 184 + "set-sink-volume" 185 + "@DEFAULT_SINK@" 186 + "-5%" 187 + ]; 188 + }; 189 + 190 + window-rules = [ 191 + { 192 + geometry-corner-radius = { 193 + top-left = 8.0; 194 + top-right = 8.0; 195 + bottom-left = 8.0; 196 + bottom-right = 8.0; 197 + }; 198 + clip-to-geometry = true; 199 + } 200 + { 201 + matches = [ { app-id = "^foot$"; } ]; 202 + open-floating = true; 203 + default-window-height.fixed = 600; 204 + } 205 + { 206 + matches = [ { app-id = "^org.keepassxc.KeePassXC$"; } ]; 207 + open-floating = true; 208 + default-window-height.fixed = 600; 209 + open-on-workspace = "8"; 210 + } 211 + { 212 + matches = [ { title = "^(Firefox (—|-) Sharing Indicator|librewolf (—|-) Sharing Indicator)$"; } ]; 213 + } 214 + { 215 + matches = [ { title = "^(Open files|About .*|Administrator privileges required)$"; } ]; 216 + open-floating = true; 217 + } 218 + { 219 + matches = [ { app-id = "^firefox$"; } ]; 220 + open-on-workspace = "1"; 221 + } 222 + { 223 + matches = [ { app-id = "^vesktop$"; } ]; 224 + open-on-workspace = "2"; 225 + } 226 + { 227 + matches = [ { app-id = "^thunderbird$"; } ]; 228 + open-on-workspace = "9"; 229 + } 230 + { 231 + matches = [ { app-id = "^spotify$"; } ]; 232 + open-on-workspace = "9"; 233 + } 234 + { 235 + matches = [ { app-id = "^tidal-hifi$"; } ]; 236 + open-on-workspace = "9"; 237 + } 238 + ]; 239 + }; 240 + }; 241 + }