Sway: Difference between revisions
m Added link to swayosd page |
m Added link to flameshot page |
||
| Line 28: | Line 28: | ||
}|name=/etc/nixos/configuration.nix|lang=nix}} | }|name=/etc/nixos/configuration.nix|lang=nix}} | ||
By default, the Sway module in NixOS comes with a set of extra packages, including the <code>foot</code> terminal, <code>swayidle</code>, <code>swaylock</code>, and <code>wmenu</code>, which | By default, the Sway module in NixOS comes with a set of extra packages, including the <code>foot</code> terminal, <code>swayidle</code>, <code>swaylock</code>, and <code>wmenu</code>, which may be configured under the <code>[https://search.nixos.org/options?show=programs.sway.extraPackages programs.sway.extraPackages]</code> option. You may also want to include <code>wl-clipboard</code> for clipboard functionality, as well as a screenshot utility such as [https://github.com/emersion/slurp Slurp] or [[Flameshot]] for screenshot region selection. | ||
Additionally, for a more customizable bar implementation than <code>sway-bar</code>, [[Waybar]] may be enabled with <code>programs.waybar.enable</code>. | |||
The default Sway configuration is symlinked to <code>/etc/sway/config</code> and <code>/etc/sway/config.d/nixos.conf</code>. The latter file contains dbus and systemd configuration that is critical to using apps that depend on XDG desktop portals with Sway, and should be included in any custom configuration files. | The default Sway configuration is symlinked to <code>/etc/sway/config</code> and <code>/etc/sway/config.d/nixos.conf</code>. The latter file contains dbus and systemd configuration that is critical to using apps that depend on XDG desktop portals with Sway, and should be included in any custom configuration files. | ||
| Line 37: | Line 39: | ||
=== Using Home Manager === | === Using Home Manager === | ||
To set up Sway using [[Home Manager]], | To set up Sway using [[Home Manager]], you must first enable [[Polkit]] in your NixOS configuration: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
security.polkit.enable = true; | security.polkit.enable = true; | ||
</nowiki>}} | </nowiki>}} | ||
Then you | Then you may enable Sway in your Home Manager configuration. Here is a minimal example: | ||
{{File|3=wayland.windowManager.sway = { | {{File|3=wayland.windowManager.sway = { | ||
| Line 261: | Line 263: | ||
=== WLR Error when trying to launch Sway === | === WLR Error when trying to launch Sway === | ||
When this happens on a new | When this happens on a new NixOS system, enabling OpenGL in configuration.nix may fix this issue. | ||
{{Note|<code>hardware.opengl</code> was renamed to <code>hardware.graphics</code> in NixOS 24.11.}} | {{Note|<code>hardware.opengl</code> was renamed to <code>hardware.graphics</code> in NixOS 24.11.}} | ||