|
| 1 | +{ |
| 2 | + pkgs, |
| 3 | + self, |
| 4 | +}: |
| 5 | + |
| 6 | +let |
| 7 | + niriWrapped = self.wrappedModules.niri.wrap { |
| 8 | + inherit pkgs; |
| 9 | + |
| 10 | + settings = { |
| 11 | + binds = { |
| 12 | + "Mod+T".spawn-sh = "alacritty"; |
| 13 | + "Mod+J".focus-column-or-monitor-left = null; |
| 14 | + "Mod+N".spawn = [ |
| 15 | + "alacritty" |
| 16 | + "msg" |
| 17 | + "create-windown" |
| 18 | + ]; |
| 19 | + "Mod+0".focus-workspace = 0; |
| 20 | + }; |
| 21 | + |
| 22 | + window-rules = [ |
| 23 | + { |
| 24 | + matches = [ { app-id = ".*"; } ]; |
| 25 | + excludes = [ |
| 26 | + { app-id = "org.keepassxc.KeePassXC"; } |
| 27 | + ]; |
| 28 | + open-focused = false; |
| 29 | + open-floating = false; |
| 30 | + } |
| 31 | + #disallow screencapture for keepass,etc. |
| 32 | + { |
| 33 | + matches = [ |
| 34 | + { app-id = "org.keepassxc.KeePassXC"; } |
| 35 | + { app-id = "thunderbird"; } |
| 36 | + ]; |
| 37 | + block-out-from = "screen-capture"; |
| 38 | + } |
| 39 | + ]; |
| 40 | + |
| 41 | + layer-rules = [ |
| 42 | + { |
| 43 | + matches = [ { namespace = "^notifications$"; } ]; |
| 44 | + block-out-from = "screen-capture"; |
| 45 | + opacity = 0.8; |
| 46 | + } |
| 47 | + ]; |
| 48 | + |
| 49 | + layout = { |
| 50 | + focus-ring.off = null; |
| 51 | + border = { |
| 52 | + width = 3; |
| 53 | + active-color = "#f5c2e7"; |
| 54 | + inactive-color = "#313244"; |
| 55 | + }; |
| 56 | + |
| 57 | + preset-column-widths = [ |
| 58 | + { proportion = 1.0; } |
| 59 | + { proportion = 1.0 / 2.0; } |
| 60 | + { proportion = 1.0 / 3.0; } |
| 61 | + { proportion = 1.0 / 4.0; } |
| 62 | + ]; |
| 63 | + }; |
| 64 | + |
| 65 | + workspaces = { |
| 66 | + "foo" = { |
| 67 | + open-on-output = "DP-3"; |
| 68 | + }; |
| 69 | + "bar" = null; |
| 70 | + }; |
| 71 | + |
| 72 | + outputs = { |
| 73 | + "DP-3" = { |
| 74 | + position = { |
| 75 | + x = 1440; |
| 76 | + y = 1080; |
| 77 | + _keys = true; |
| 78 | + }; |
| 79 | + background-color = "#003300"; |
| 80 | + hot-corners = { |
| 81 | + off = null; |
| 82 | + }; |
| 83 | + }; |
| 84 | + }; |
| 85 | + |
| 86 | + spawn-at-startup = [ |
| 87 | + "hello" |
| 88 | + [ |
| 89 | + "nix" |
| 90 | + "build" |
| 91 | + ] |
| 92 | + ]; |
| 93 | + hotkey-overlay.skip-at-startup = [ ]; |
| 94 | + prefer-no-csd = true; |
| 95 | + overview.zoom = 0.25; |
| 96 | + }; |
| 97 | + }; |
| 98 | +in |
| 99 | +if builtins.elem pkgs.stdenv.hostPlatform.system self.wrappedModules.niri.meta.platforms then |
| 100 | + pkgs.runCommand "niri-test" { } '' |
| 101 | + cat ${niriWrapped}/bin/niri |
| 102 | + "${niriWrapped}/bin/niri" --version | grep -q "${niriWrapped.version}" |
| 103 | + "${niriWrapped}/bin/niri" validate |
| 104 | + # since config is now checked at build time, testing a bad config is impossible |
| 105 | + touch $out |
| 106 | + '' |
| 107 | +else |
| 108 | + null |
0 commit comments