diff options
Diffstat (limited to 'usecases')
-rw-r--r-- | usecases/desktop/graphical/sway.nix | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/usecases/desktop/graphical/sway.nix b/usecases/desktop/graphical/sway.nix index 73e9aa4..4e15552 100644 --- a/usecases/desktop/graphical/sway.nix +++ b/usecases/desktop/graphical/sway.nix | |||
@@ -1,16 +1,18 @@ | |||
1 | inputs: | 1 | _inputs: { |
2 | 2 | config, | |
3 | { config, lib, pkgs, system, ... }: | 3 | lib, |
4 | let | 4 | pkgs, |
5 | system, | ||
6 | ... | ||
7 | }: let | ||
5 | globalConfig = config; | 8 | globalConfig = config; |
6 | in | 9 | in { |
7 | { | ||
8 | services.greetd = { | 10 | services.greetd = { |
9 | enable = true; | 11 | enable = true; |
10 | settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; | 12 | settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; |
11 | }; | 13 | }; |
12 | 14 | ||
13 | home-manager.users.minijackson = { config, ... }: { | 15 | home-manager.users.minijackson = {config, ...}: { |
14 | wayland.windowManager.sway = { | 16 | wayland.windowManager.sway = { |
15 | enable = true; | 17 | enable = true; |
16 | 18 | ||
@@ -35,7 +37,7 @@ in | |||
35 | 37 | ||
36 | config = { | 38 | config = { |
37 | # Using waybar | 39 | # Using waybar |
38 | bars = [ ]; | 40 | bars = []; |
39 | 41 | ||
40 | colors = with globalConfig.theme.colors; { | 42 | colors = with globalConfig.theme.colors; { |
41 | focused = { | 43 | focused = { |
@@ -80,7 +82,7 @@ in | |||
80 | }; | 82 | }; |
81 | 83 | ||
82 | floating.criteria = [ | 84 | floating.criteria = [ |
83 | { title = "Steam - News"; } | 85 | {title = "Steam - News";} |
84 | ]; | 86 | ]; |
85 | 87 | ||
86 | input = { | 88 | input = { |
@@ -104,7 +106,6 @@ in | |||
104 | xkb_numlock = "enabled"; | 106 | xkb_numlock = "enabled"; |
105 | }; | 107 | }; |
106 | 108 | ||
107 | |||
108 | "1133:49948:Logitech_USB_Keyboard" = { | 109 | "1133:49948:Logitech_USB_Keyboard" = { |
109 | xkb_layout = "fr"; | 110 | xkb_layout = "fr"; |
110 | xkb_variant = "oss"; | 111 | xkb_variant = "oss"; |
@@ -118,10 +119,9 @@ in | |||
118 | }; | 119 | }; |
119 | }; | 120 | }; |
120 | 121 | ||
121 | keybindings = | 122 | keybindings = let |
122 | let | 123 | modifier = config.wayland.windowManager.sway.config.modifier; |
123 | modifier = config.wayland.windowManager.sway.config.modifier; | 124 | in |
124 | in | ||
125 | lib.mkOptionDefault { | 125 | lib.mkOptionDefault { |
126 | "${modifier}+ampersand" = "workspace 1"; | 126 | "${modifier}+ampersand" = "workspace 1"; |
127 | "${modifier}+eacute" = "workspace 2"; | 127 | "${modifier}+eacute" = "workspace 2"; |
@@ -153,22 +153,24 @@ in | |||
153 | }; | 153 | }; |
154 | 154 | ||
155 | menu = '' | 155 | menu = '' |
156 | ${pkgs.rofi}/bin/rofi -show drun -terminal ${pkgs.alacritty}/bin/alacritty | 156 | rofi -show drun -terminal alacritty -modi "drun,run,filebrowser,emoji" |
157 | ''; | 157 | ''; |
158 | 158 | ||
159 | modifier = "Mod4"; | 159 | modifier = "Mod4"; |
160 | 160 | ||
161 | output."*".bg = | 161 | output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; |
162 | "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; | ||
163 | 162 | ||
164 | startup = [ | 163 | startup = [ |
165 | { command = "${pkgs.mako}/bin/mako"; always = true; } | 164 | { |
165 | command = "${pkgs.mako}/bin/mako"; | ||
166 | always = true; | ||
167 | } | ||
166 | { | 168 | { |
167 | command = "\"systemctl --user import-environment ${ | 169 | command = "\"systemctl --user import-environment ${ |
168 | builtins.toString (lib.unique config.xsession.importedVariables) | 170 | builtins.toString (lib.unique config.xsession.importedVariables) |
169 | }; systemctl --user start sway-session.target\""; | 171 | }; systemctl --user start sway-session.target\""; |
170 | } | 172 | } |
171 | { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } | 173 | {command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";} |
172 | ]; | 174 | ]; |
173 | 175 | ||
174 | terminal = "${pkgs.alacritty}/bin/alacritty"; | 176 | terminal = "${pkgs.alacritty}/bin/alacritty"; |
@@ -248,10 +250,10 @@ in | |||
248 | systemd.user.targets.sway-session = { | 250 | systemd.user.targets.sway-session = { |
249 | Unit = { | 251 | Unit = { |
250 | Description = "sway compositor session"; | 252 | Description = "sway compositor session"; |
251 | Documentation = [ "man:systemd.special(7)" ]; | 253 | Documentation = ["man:systemd.special(7)"]; |
252 | BindsTo = [ "graphical-session.target" ]; | 254 | BindsTo = ["graphical-session.target"]; |
253 | Wants = [ "graphical-session-pre.target" ]; | 255 | Wants = ["graphical-session-pre.target"]; |
254 | After = [ "graphical-session-pre.target" ]; | 256 | After = ["graphical-session-pre.target"]; |
255 | }; | 257 | }; |
256 | }; | 258 | }; |
257 | }; | 259 | }; |
@@ -266,7 +268,7 @@ in | |||
266 | ]; | 268 | ]; |
267 | 269 | ||
268 | programs.xwayland.enable = true; | 270 | programs.xwayland.enable = true; |
269 | security.pam.services.swaylock = { }; | 271 | security.pam.services.swaylock = {}; |
270 | 272 | ||
271 | xdg.portal.extraPortals = with pkgs; [ | 273 | xdg.portal.extraPortals = with pkgs; [ |
272 | unstable.xdg-desktop-portal-wlr | 274 | unstable.xdg-desktop-portal-wlr |