my system configurations ^-^
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: niri under an option

willow 8b239954 9d100094

+269 -249
+14 -7
modules/nixos/desktop/niri.nix
··· 1 1 { 2 2 pkgs, 3 3 inputs, 4 + config, 5 + lib, 4 6 ... 5 - }: { 7 + }: let 8 + cfg = config.settings.desktop.niri; 9 + in { 6 10 imports = [inputs.niri.nixosModules.niri]; 7 - niri-flake.cache.enable = true; 8 - nixpkgs.overlays = [inputs.niri.overlays.niri]; 11 + 12 + config = lib.mkIf cfg.enable { 13 + niri-flake.cache.enable = true; 14 + nixpkgs.overlays = [inputs.niri.overlays.niri]; 9 15 10 - # build first with niri disabled, then enable after cache is added 11 - programs.niri = { 12 - enable = true; 13 - package = pkgs.niri-unstable; 16 + # build first with niri disabled, then enable after cache is added 17 + programs.niri = { 18 + enable = true; 19 + package = pkgs.niri-unstable; 20 + }; 14 21 }; 15 22 }
+5
modules/nixos/options/default.nix
··· 170 170 // { 171 171 default = true; 172 172 }; 173 + niri.enable = 174 + mkEnableOption "Enable Niri twm" 175 + // { 176 + default = cfg.desktop.enable; 177 + }; 173 178 hyprland.enable = 174 179 mkEnableOption "Enable Hyprland and its ecosystem" 175 180 // {
+151 -147
user/desktop/niri/binds.nix
··· 2 2 lib, 3 3 pkgs, 4 4 config, 5 + osConfig, 5 6 ... 6 7 }: let 8 + cfg = osConfig.settings.desktop.niri; 7 9 wpctl = lib.getExe' pkgs.wireplumber "wpctl"; 8 10 in { 9 - programs.niri.settings.binds = 10 - { 11 - # ==== Actions ==== 12 - "Mod+Shift+Slash".action.show-hotkey-overlay = []; 13 - "Mod+B".action.power-off-monitors = []; 11 + config = lib.mkIf cfg.enable { 12 + programs.niri.settings.binds = 13 + { 14 + # ==== Actions ==== 15 + "Mod+Shift+Slash".action.show-hotkey-overlay = []; 16 + "Mod+B".action.power-off-monitors = []; 14 17 15 - "Mod+C".action.close-window = []; 16 - "Mod+Escape".action.toggle-overview = []; 18 + "Mod+C".action.close-window = []; 19 + "Mod+Escape".action.toggle-overview = []; 17 20 18 - "Mod+Shift+Q".action.quit = []; 21 + "Mod+Shift+Q".action.quit = []; 19 22 20 - "Print".action.screenshot = []; 21 - "Mod+Print".action.screenshot-screen = []; 22 - "Alt+Print".action.screenshot-window = []; 23 + "Print".action.screenshot = []; 24 + "Mod+Print".action.screenshot-screen = []; 25 + "Alt+Print".action.screenshot-window = []; 23 26 24 - # ==== Spawn ==== 25 - "Mod+F".action.spawn = "firefox"; 26 - "Mod+L".action.spawn = lib.getExe config.programs.hyprlock.package; 27 - "Mod+P".action.spawn = lib.getExe pkgs.kooha; 28 - "Mod+Q".action.spawn = lib.getExe config.programs.alacritty.package; 29 - "Mod+T".action.spawn = lib.getExe pkgs.vesktop; 30 - "Mod+W".action.spawn = "nautilus"; 31 - "Mod+X".action.spawn = "zeditor"; 32 - "Mod+Space".action.spawn = ["${lib.getExe' pkgs.tofi "tofi-drun"}" "--drun-launch=true" "--fuzzy-match=true"]; 27 + # ==== Spawn ==== 28 + "Mod+F".action.spawn = "firefox"; 29 + "Mod+L".action.spawn = lib.getExe config.programs.hyprlock.package; 30 + "Mod+P".action.spawn = lib.getExe pkgs.kooha; 31 + "Mod+Q".action.spawn = lib.getExe config.programs.alacritty.package; 32 + "Mod+T".action.spawn = lib.getExe pkgs.vesktop; 33 + "Mod+W".action.spawn = "nautilus"; 34 + "Mod+X".action.spawn = "zeditor"; 35 + "Mod+Space".action.spawn = ["${lib.getExe' pkgs.tofi "tofi-drun"}" "--drun-launch=true" "--fuzzy-match=true"]; 33 36 34 - # ==== Windows ==== 35 - "Mod+N".action.focus-column-or-monitor-left = []; 36 - "Mod+E".action.focus-window-or-workspace-down = []; 37 - "Mod+I".action.focus-window-or-workspace-up = []; 38 - "Mod+O".action.focus-column-or-monitor-right = []; 39 - "Mod+Shift+WheelScrollUp".action.focus-column-or-monitor-left = []; 40 - "Mod+WheelScrollDown".action.focus-window-or-workspace-down = []; 41 - "Mod+WheelScrollUp".action.focus-window-or-workspace-up = []; 42 - "Mod+Shift+WheelScrollDown".action.focus-column-or-monitor-right = []; 37 + # ==== Windows ==== 38 + "Mod+N".action.focus-column-or-monitor-left = []; 39 + "Mod+E".action.focus-window-or-workspace-down = []; 40 + "Mod+I".action.focus-window-or-workspace-up = []; 41 + "Mod+O".action.focus-column-or-monitor-right = []; 42 + "Mod+Shift+WheelScrollUp".action.focus-column-or-monitor-left = []; 43 + "Mod+WheelScrollDown".action.focus-window-or-workspace-down = []; 44 + "Mod+WheelScrollUp".action.focus-window-or-workspace-up = []; 45 + "Mod+Shift+WheelScrollDown".action.focus-column-or-monitor-right = []; 43 46 44 - "Alt+N".action.move-column-left-or-to-monitor-left = []; 45 - "Alt+E".action.move-window-down-or-to-workspace-down = []; 46 - "Alt+I".action.move-window-up-or-to-workspace-up = []; 47 - "Alt+O".action.move-column-right-or-to-monitor-right = []; 48 - "Alt+Shift+WheelScrollUp".action.move-column-left-or-to-monitor-left = []; 49 - "Alt+WheelScrollDown".action.move-window-down-or-to-workspace-down = []; 50 - "Alt+WheelScrollUp".action.move-window-up-or-to-workspace-up = []; 51 - "Alt+Shift+WheelScrollDown".action.move-column-right-or-to-monitor-right = []; 47 + "Alt+N".action.move-column-left-or-to-monitor-left = []; 48 + "Alt+E".action.move-window-down-or-to-workspace-down = []; 49 + "Alt+I".action.move-window-up-or-to-workspace-up = []; 50 + "Alt+O".action.move-column-right-or-to-monitor-right = []; 51 + "Alt+Shift+WheelScrollUp".action.move-column-left-or-to-monitor-left = []; 52 + "Alt+WheelScrollDown".action.move-window-down-or-to-workspace-down = []; 53 + "Alt+WheelScrollUp".action.move-window-up-or-to-workspace-up = []; 54 + "Alt+Shift+WheelScrollDown".action.move-column-right-or-to-monitor-right = []; 52 55 53 - "Mod+Shift+N".action.focus-monitor-left = []; 54 - "Mod+Shift+O".action.focus-monitor-right = []; 55 - "Mod+MouseBack".action.focus-monitor-left = []; 56 - "Mod+MouseForward".action.focus-monitor-right = []; 56 + "Mod+Shift+N".action.focus-monitor-left = []; 57 + "Mod+Shift+O".action.focus-monitor-right = []; 58 + "Mod+MouseBack".action.focus-monitor-left = []; 59 + "Mod+MouseForward".action.focus-monitor-right = []; 57 60 58 - "Alt+Shift+N".action.move-workspace-to-monitor-left = []; 59 - "Alt+Shift+E".action.move-workspace-down = []; 60 - "Alt+Shift+I".action.move-workspace-up = []; 61 - "Alt+Shift+O".action.move-workspace-to-monitor-right = []; 62 - "Alt+MouseBack".action.move-workspace-to-monitor-left = []; 63 - "Alt+MouseForward".action.move-workspace-to-monitor-right = []; 61 + "Alt+Shift+N".action.move-workspace-to-monitor-left = []; 62 + "Alt+Shift+E".action.move-workspace-down = []; 63 + "Alt+Shift+I".action.move-workspace-up = []; 64 + "Alt+Shift+O".action.move-workspace-to-monitor-right = []; 65 + "Alt+MouseBack".action.move-workspace-to-monitor-left = []; 66 + "Alt+MouseForward".action.move-workspace-to-monitor-right = []; 64 67 65 - "Mod+Comma".action.consume-window-into-column = []; 66 - "Mod+Period".action.expel-window-from-column = []; 68 + "Mod+Comma".action.consume-window-into-column = []; 69 + "Mod+Period".action.expel-window-from-column = []; 67 70 68 - "Mod+R".action.switch-preset-column-width = []; 69 - "Alt+R".action.switch-preset-window-height = []; 70 - "Mod+S".action.maximize-column = []; 71 - "Alt+S".action.reset-window-height = []; 71 + "Mod+R".action.switch-preset-column-width = []; 72 + "Alt+R".action.switch-preset-window-height = []; 73 + "Mod+S".action.maximize-column = []; 74 + "Alt+S".action.reset-window-height = []; 72 75 73 - # === Special Keys ==== 74 - XF86MonBrightnessUp = { 75 - cooldown-ms = 50; 76 - action.spawn = [ 77 - "brightnessctl" 78 - "set" 79 - "+5%" 80 - ]; 81 - }; 82 - XF86MonBrightnessDown = { 83 - cooldown-ms = 50; 84 - action.spawn = [ 85 - "brightnessctl" 86 - "set" 87 - "5%-" 88 - ]; 89 - }; 90 - XF86AudioRaiseVolume = { 91 - allow-when-locked = true; 92 - cooldown-ms = 50; 93 - action.spawn = [ 94 - wpctl 95 - "set-volume" 96 - "@DEFAULT_AUDIO_SINK@" 97 - "0.05+" 98 - "-l" 99 - "1.0" 100 - ]; 101 - }; 102 - XF86AudioLowerVolume = { 103 - allow-when-locked = true; 104 - cooldown-ms = 50; 105 - action.spawn = [ 106 - wpctl 107 - "set-volume" 108 - "@DEFAULT_AUDIO_SINK@" 109 - "0.05-" 110 - ]; 111 - }; 112 - XF86AudioMute = { 113 - allow-when-locked = true; 114 - action.spawn = [ 115 - wpctl 116 - "set-mute" 117 - "@DEFAULT_AUDIO_SINK@" 118 - "toggle" 119 - ]; 120 - }; 121 - XF86AudioMicMute = { 122 - allow-when-locked = true; 123 - action.spawn = [ 124 - wpctl 125 - "set-mute" 126 - "@DEFAULT_AUDIO_SOURCE@" 127 - "toggle" 128 - ]; 129 - }; 130 - XF86AudioPlay = { 131 - allow-when-locked = true; 132 - action.spawn = [ 133 - "playerctl" 134 - "play-pause" 135 - ]; 136 - }; 137 - XF86AudioPause = { 138 - allow-when-locked = true; 139 - action.spawn = [ 140 - "playerctl" 141 - "play-pause" 142 - ]; 143 - }; 144 - XF86AudioNext = { 145 - allow-when-locked = true; 146 - action.spawn = [ 147 - "playerctl" 148 - "next" 149 - ]; 150 - }; 151 - XF86AudioPrev = { 152 - allow-when-locked = true; 153 - action.spawn = [ 154 - "playerctl" 155 - "previous" 156 - ]; 157 - }; 158 - } 159 - // lib.foldl' ( 160 - attr: i: 161 - attr 162 - // { 163 - "Mod+${toString i}".action.focus-workspace = i; 164 - "Alt+${toString i}".action.move-window-to-workspace = i; 165 - } 166 - ) {} (lib.range 1 9); 76 + # === Special Keys ==== 77 + XF86MonBrightnessUp = { 78 + cooldown-ms = 50; 79 + action.spawn = [ 80 + "brightnessctl" 81 + "set" 82 + "+5%" 83 + ]; 84 + }; 85 + XF86MonBrightnessDown = { 86 + cooldown-ms = 50; 87 + action.spawn = [ 88 + "brightnessctl" 89 + "set" 90 + "5%-" 91 + ]; 92 + }; 93 + XF86AudioRaiseVolume = { 94 + allow-when-locked = true; 95 + cooldown-ms = 50; 96 + action.spawn = [ 97 + wpctl 98 + "set-volume" 99 + "@DEFAULT_AUDIO_SINK@" 100 + "0.05+" 101 + "-l" 102 + "1.0" 103 + ]; 104 + }; 105 + XF86AudioLowerVolume = { 106 + allow-when-locked = true; 107 + cooldown-ms = 50; 108 + action.spawn = [ 109 + wpctl 110 + "set-volume" 111 + "@DEFAULT_AUDIO_SINK@" 112 + "0.05-" 113 + ]; 114 + }; 115 + XF86AudioMute = { 116 + allow-when-locked = true; 117 + action.spawn = [ 118 + wpctl 119 + "set-mute" 120 + "@DEFAULT_AUDIO_SINK@" 121 + "toggle" 122 + ]; 123 + }; 124 + XF86AudioMicMute = { 125 + allow-when-locked = true; 126 + action.spawn = [ 127 + wpctl 128 + "set-mute" 129 + "@DEFAULT_AUDIO_SOURCE@" 130 + "toggle" 131 + ]; 132 + }; 133 + XF86AudioPlay = { 134 + allow-when-locked = true; 135 + action.spawn = [ 136 + "playerctl" 137 + "play-pause" 138 + ]; 139 + }; 140 + XF86AudioPause = { 141 + allow-when-locked = true; 142 + action.spawn = [ 143 + "playerctl" 144 + "play-pause" 145 + ]; 146 + }; 147 + XF86AudioNext = { 148 + allow-when-locked = true; 149 + action.spawn = [ 150 + "playerctl" 151 + "next" 152 + ]; 153 + }; 154 + XF86AudioPrev = { 155 + allow-when-locked = true; 156 + action.spawn = [ 157 + "playerctl" 158 + "previous" 159 + ]; 160 + }; 161 + } 162 + // lib.foldl' ( 163 + attr: i: 164 + attr 165 + // { 166 + "Mod+${toString i}".action.focus-workspace = i; 167 + "Alt+${toString i}".action.move-window-to-workspace = i; 168 + } 169 + ) {} (lib.range 1 9); 170 + }; 167 171 }
+99 -95
user/desktop/niri/default.nix
··· 4 4 config, 5 5 lib, 6 6 ... 7 - }: { 7 + }: let 8 + cfg = osConfig.settings.desktop.niri; 9 + in { 8 10 imports = [ 9 11 ./binds.nix 10 12 ]; 11 13 12 - programs.niri.settings = { 13 - animations.enable = true; 14 - prefer-no-csd = true; 14 + config = lib.mkIf cfg.enable { 15 + programs.niri.settings = { 16 + animations.enable = true; 17 + prefer-no-csd = true; 15 18 16 - cursor = { 17 - inherit (config.stylix.cursor) size; 18 - theme = config.stylix.cursor.name; 19 - }; # TODO)) this doesn't fix the big cursor issue 19 + cursor = { 20 + inherit (config.stylix.cursor) size; 21 + theme = config.stylix.cursor.name; 22 + }; # TODO)) this doesn't fix the big cursor issue 20 23 21 - outputs = let 22 - default = { 23 - backdrop-color = "#1e2030"; 24 - }; 25 - in { 26 - DP-1 = 27 - default 28 - // { 29 - position = { 30 - x = 0; 31 - y = 0; 32 - }; 24 + outputs = let 25 + default = { 26 + backdrop-color = "#1e2030"; 33 27 }; 34 - DP-2 = 35 - default 36 - // { 37 - position = { 38 - x = 0; 39 - y = 0; 28 + in { 29 + DP-1 = 30 + default 31 + // { 32 + position = { 33 + x = 0; 34 + y = 0; 35 + }; 40 36 }; 41 - }; 42 - eDP-1 = 43 - default 44 - // { 45 - scale = 1; 46 - position = { 47 - x = 2560; 48 - y = 0; 37 + DP-2 = 38 + default 39 + // { 40 + position = { 41 + x = 0; 42 + y = 0; 43 + }; 49 44 }; 50 - }; 51 - }; 52 - window-rules = [ 53 - { 54 - geometry-corner-radius = let 55 - radius = 8.0; 56 - in { 57 - bottom-left = radius; 58 - bottom-right = radius; 59 - top-left = radius; 60 - top-right = radius; 61 - }; 62 - clip-to-geometry = true; 63 - } 64 - # { 65 - # # screencasted windows 66 - # matches = [{is-window-cast-target = true;}]; 67 - # border = { 68 - # active-color = "#ed8796"; 69 - # }; 70 - # } 71 - ]; 72 - spawn-at-startup = [ 73 - { 74 - command = [(lib.getExe pkgs.xwayland-satellite-unstable)]; 75 - } 76 - { 77 - command = ["qs"]; 78 - } 79 - ]; 80 - environment = { 81 - DISPLAY = ":0"; # xwayland-satellite 82 - }; 83 - 84 - input = { 85 - keyboard.xkb = { 86 - inherit (osConfig.services.xserver.xkb) layout variant options; 45 + eDP-1 = 46 + default 47 + // { 48 + scale = 1; 49 + position = { 50 + x = 2560; 51 + y = 0; 52 + }; 53 + }; 87 54 }; 88 - touchpad = { 89 - accel-speed = 0.4; 55 + window-rules = [ 56 + { 57 + geometry-corner-radius = let 58 + radius = 8.0; 59 + in { 60 + bottom-left = radius; 61 + bottom-right = radius; 62 + top-left = radius; 63 + top-right = radius; 64 + }; 65 + clip-to-geometry = true; 66 + } 67 + # { 68 + # # screencasted windows 69 + # matches = [{is-window-cast-target = true;}]; 70 + # border = { 71 + # active-color = "#ed8796"; 72 + # }; 73 + # } 74 + ]; 75 + spawn-at-startup = [ 76 + { 77 + command = [(lib.getExe pkgs.xwayland-satellite-unstable)]; 78 + } 79 + { 80 + command = ["qs"]; 81 + } 82 + ]; 83 + environment = { 84 + DISPLAY = ":0"; # xwayland-satellite 90 85 }; 91 - focus-follows-mouse = { 92 - # allow focus-follows-mouse only when it will not scroll the view 93 - enable = true; 94 - max-scroll-amount = "0%"; 86 + 87 + input = { 88 + keyboard.xkb = { 89 + inherit (osConfig.services.xserver.xkb) layout variant options; 90 + }; 91 + touchpad = { 92 + accel-speed = 0.4; 93 + }; 94 + focus-follows-mouse = { 95 + # allow focus-follows-mouse only when it will not scroll the view 96 + enable = true; 97 + max-scroll-amount = "0%"; 98 + }; 95 99 }; 96 - }; 97 100 98 - screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d_%H:%M:%S.png"; 101 + screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d_%H:%M:%S.png"; 99 102 100 - layout = { 101 - gaps = 5; 102 - center-focused-column = "never"; 103 + layout = { 104 + gaps = 5; 105 + center-focused-column = "never"; 103 106 104 - preset-column-widths = [ 105 - {proportion = 1.0 / 3.0;} 106 - {proportion = 1.0 / 2.0;} 107 - {proportion = 2.0 / 3.0;} 108 - ]; 109 - default-column-width.proportion = 0.5; 107 + preset-column-widths = [ 108 + {proportion = 1.0 / 3.0;} 109 + {proportion = 1.0 / 2.0;} 110 + {proportion = 2.0 / 3.0;} 111 + ]; 112 + default-column-width.proportion = 0.5; 110 113 111 - border = { 112 - enable = true; 113 - width = 2; 114 + border = { 115 + enable = true; 116 + width = 2; 114 117 115 - active.color = "#f5bde6"; 116 - inactive.color = "#24273a"; 118 + active.color = "#f5bde6"; 119 + inactive.color = "#24273a"; 120 + }; 121 + focus-ring.enable = false; 122 + insert-hint.display.color = "#f5bde680"; 117 123 }; 118 - focus-ring.enable = false; 119 - insert-hint.display.color = "#f5bde680"; 120 124 }; 121 125 }; 122 126 }