diff --git a/nix/configuration/roles/sway/default.nix b/nix/configuration/roles/sway/default.nix index 95fc58e..6061322 100644 --- a/nix/configuration/roles/sway/default.nix +++ b/nix/configuration/roles/sway/default.nix @@ -1,5 +1,44 @@ { config, lib, pkgs, ... }: +let + sway-config = pkgs.writeTextFile { + name = "config"; + text = '' +# Default config for sway +# +# Copy this to ~/.config/sway/config and edit it to your liking. +# +# Read `man 5 sway` for a complete reference. + +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# set $mod Mod1 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term ${pkgs.alacritty}/bin/alacritty +# Your preferred application launcher +# Note: it's recommended that you pass the final command to sway +# set $menu dmenu_path | dmenu | xargs swaymsg exec +set $menu ${pkgs.wofi}/bin/wofi --show drun --gtk-dark + +# Do not show a title bar on windows +default_border pixel 2 + +bindsym $mod+grave exec $term + +exec ${pkgs.alacritty}/bin/alacritty + +include ~/.config/sway/config.d/*.conf +include /etc/sway/config.d/* + ''; + }; +in { imports = []; @@ -7,6 +46,7 @@ alacritty firefox ]; + hardware.opengl.enable = true; environment.sessionVariables = { WLR_RENDERER_ALLOW_SOFTWARE = "1"; @@ -18,7 +58,7 @@ extraOptions = [ "--debug" "--config" - "${./files/config}" + "${sway-config}" "--unsupported-gpu" ]; }; diff --git a/nix/configuration/roles/sway/files/config b/nix/configuration/roles/sway/files/config deleted file mode 100644 index 525c388..0000000 --- a/nix/configuration/roles/sway/files/config +++ /dev/null @@ -1,32 +0,0 @@ -# Default config for sway -# -# Copy this to ~/.config/sway/config and edit it to your liking. -# -# Read `man 5 sway` for a complete reference. - -### Variables -# -# Logo key. Use Mod1 for Alt. -set $mod Mod4 -# set $mod Mod1 -# Home row direction keys, like vim -set $left h -set $down j -set $up k -set $right l -# Your preferred terminal emulator -set $term alacritty -# Your preferred application launcher -# Note: it's recommended that you pass the final command to sway -# set $menu dmenu_path | dmenu | xargs swaymsg exec -set $menu wofi --show drun --gtk-dark - -# Do not show a title bar on windows -default_border pixel 2 - -bindsym $mod+grave exec $term - -exec alacritty - -include ~/.config/sway/config.d/*.conf -include /etc/sway/config.d/*