diff options
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/sway-beta.nix | 91 | ||||
-rw-r--r-- | nixos/modules/programs/sway.nix | 61 | ||||
-rw-r--r-- | pkgs/applications/window-managers/sway/beta.nix | 54 | ||||
-rw-r--r-- | pkgs/applications/window-managers/sway/default.nix | 44 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 1 |
6 files changed, 59 insertions, 193 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 032452428f18..2c7b15e65c49 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -129,7 +129,6 @@ ./programs/sysdig.nix ./programs/systemtap.nix ./programs/sway.nix - ./programs/sway-beta.nix ./programs/thefuck.nix ./programs/tmux.nix ./programs/udevil.nix diff --git a/nixos/modules/programs/sway-beta.nix b/nixos/modules/programs/sway-beta.nix deleted file mode 100644 index 3c235de0ce63..000000000000 --- a/nixos/modules/programs/sway-beta.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let - cfg = config.programs.sway-beta; - swayPackage = cfg.package; - - swayWrapped = pkgs.writeShellScriptBin "sway" '' - set -o errexit - - if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then - export _SWAY_WRAPPER_ALREADY_EXECUTED=1 - ${cfg.extraSessionCommands} - fi - - if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then - export DBUS_SESSION_BUS_ADDRESS - exec ${swayPackage}/bin/sway "$@" - else - exec ${pkgs.dbus}/bin/dbus-run-session ${swayPackage}/bin/sway "$@" - fi - ''; - swayJoined = pkgs.symlinkJoin { - name = "sway-joined"; - paths = [ swayWrapped swayPackage ]; - }; -in { - options.programs.sway-beta = { - enable = mkEnableOption '' - Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 - ''; - - package = mkOption { - type = types.package; - default = pkgs.sway-beta; - defaultText = "pkgs.sway-beta"; - description = '' - The package to be used for `sway`. - ''; - }; - - extraSessionCommands = mkOption { - type = types.lines; - default = ""; - example = '' - export SDL_VIDEODRIVER=wayland - # needs qt5.qtwayland in systemPackages - export QT_QPA_PLATFORM=wayland - export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" - # Fix for some Java AWT applications (e.g. Android Studio), - # use this if they aren't displayed properly: - export _JAVA_AWT_WM_NONREPARENTING=1 - ''; - description = '' - Shell commands executed just before Sway is started. - ''; - }; - - extraPackages = mkOption { - type = with types; listOf package; - default = with pkgs; [ - swaylock swayidle - xwayland rxvt_unicode dmenu - ]; - defaultText = literalExample '' - with pkgs; [ swaylock swayidle xwayland rxvt_unicode dmenu ]; - ''; - example = literalExample '' - with pkgs; [ - xwayland - i3status i3status-rust - termite rofi light - ] - ''; - description = '' - Extra packages to be installed system wide. - ''; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; - security.pam.services.swaylock = {}; - hardware.opengl.enable = mkDefault true; - fonts.enableDefaultFonts = mkDefault true; - programs.dconf.enable = mkDefault true; - }; - - meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ]; -} diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix index b3847db8cd9c..3c235de0ce63 100644 --- a/nixos/modules/programs/sway.nix +++ b/nixos/modules/programs/sway.nix @@ -3,8 +3,8 @@ with lib; let - cfg = config.programs.sway; - swayPackage = pkgs.sway; + cfg = config.programs.sway-beta; + swayPackage = cfg.package; swayWrapped = pkgs.writeShellScriptBin "sway" '' set -o errexit @@ -16,9 +16,9 @@ let if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then export DBUS_SESSION_BUS_ADDRESS - exec sway-setcap "$@" + exec ${swayPackage}/bin/sway "$@" else - exec ${pkgs.dbus}/bin/dbus-run-session sway-setcap "$@" + exec ${pkgs.dbus}/bin/dbus-run-session ${swayPackage}/bin/sway "$@" fi ''; swayJoined = pkgs.symlinkJoin { @@ -26,24 +26,31 @@ let paths = [ swayWrapped swayPackage ]; }; in { - options.programs.sway = { + options.programs.sway-beta = { enable = mkEnableOption '' - the tiling Wayland compositor Sway. After adding yourself to the "sway" - group you can manually launch Sway by executing "sway" from a terminal. - If you call "sway" with any parameters the extraSessionCommands won't be - executed and Sway won't be launched with dbus-launch''; + Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 + ''; + + package = mkOption { + type = types.package; + default = pkgs.sway-beta; + defaultText = "pkgs.sway-beta"; + description = '' + The package to be used for `sway`. + ''; + }; extraSessionCommands = mkOption { type = types.lines; default = ""; example = '' - # Define a keymap (US QWERTY is the default) - export XKB_DEFAULT_LAYOUT=de,us - export XKB_DEFAULT_VARIANT=nodeadkeys - export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle,caps:escape - # Change the Keyboard repeat delay and rate - export WLC_REPEAT_DELAY=660 - export WLC_REPEAT_RATE=25 + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 ''; description = '' Shell commands executed just before Sway is started. @@ -53,14 +60,17 @@ in { extraPackages = mkOption { type = with types; listOf package; default = with pkgs; [ - i3status xwayland rxvt_unicode dmenu + swaylock swayidle + xwayland rxvt_unicode dmenu ]; defaultText = literalExample '' - with pkgs; [ i3status xwayland rxvt_unicode dmenu ]; + with pkgs; [ swaylock swayidle xwayland rxvt_unicode dmenu ]; ''; example = literalExample '' with pkgs; [ - i3lock light termite + xwayland + i3status i3status-rust + termite rofi light ] ''; description = '' @@ -71,22 +81,11 @@ in { config = mkIf cfg.enable { environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; - security.wrappers.sway = { - program = "sway-setcap"; - source = "${swayPackage}/bin/sway"; - capabilities = "cap_sys_ptrace,cap_sys_tty_config=eip"; - owner = "root"; - group = "sway"; - permissions = "u+rx,g+rx"; - }; - - users.groups.sway = {}; security.pam.services.swaylock = {}; - hardware.opengl.enable = mkDefault true; fonts.enableDefaultFonts = mkDefault true; programs.dconf.enable = mkDefault true; }; - meta.maintainers = with lib.maintainers; [ gnidorah primeos ]; + meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ]; } diff --git a/pkgs/applications/window-managers/sway/beta.nix b/pkgs/applications/window-managers/sway/beta.nix deleted file mode 100644 index 4aa3ee18cd21..000000000000 --- a/pkgs/applications/window-managers/sway/beta.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ stdenv, fetchFromGitHub, fetchpatch -, meson, ninja -, pkgconfig, scdoc -, wayland, libxkbcommon, pcre, json_c, dbus, libevdev -, pango, cairo, libinput, libcap, pam, gdk_pixbuf -, wlroots, wayland-protocols -, buildDocs ? true -}: - -stdenv.mkDerivation rec { - name = "${pname}-${version}"; - pname = "sway"; - version = "1.0"; - - src = fetchFromGitHub { - owner = "swaywm"; - repo = "sway"; - rev = version; - sha256 = "09cndc2nl39d3l7g5634xp0pxcz60pvc5277mfw89r22mh0j78rx"; - }; - - patches = [ - # Fix for a compiler warning that causes a build failure - # (see https://github.com/swaywm/sway/issues/3862): - (fetchpatch { - url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch"; - sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp"; - }) - ]; - - nativeBuildInputs = [ - pkgconfig meson ninja - ] ++ stdenv.lib.optional buildDocs scdoc; - - buildInputs = [ - wayland libxkbcommon pcre json_c dbus libevdev - pango cairo libinput libcap pam gdk_pixbuf - wlroots wayland-protocols - ]; - - enableParallelBuilding = true; - - mesonFlags = [ - "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled" "-Dtray=enabled" - ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled"; - - meta = with stdenv.lib; { - description = "i3-compatible window manager for Wayland"; - homepage = https://swaywm.org; - license = licenses.mit; - platforms = platforms.linux; - maintainers = with maintainers; [ primeos synthetica ]; - }; -} diff --git a/pkgs/applications/window-managers/sway/default.nix b/pkgs/applications/window-managers/sway/default.nix index fb30f0073bfd..4aa3ee18cd21 100644 --- a/pkgs/applications/window-managers/sway/default.nix +++ b/pkgs/applications/window-managers/sway/default.nix @@ -1,40 +1,54 @@ -{ stdenv, fetchFromGitHub -, cmake, pkgconfig, asciidoc, libxslt, docbook_xsl -, wayland, wlc, libxkbcommon, pcre, json_c, dbus -, pango, cairo, libinput, libcap, pam, gdk_pixbuf, libpthreadstubs -, libXdmcp +{ stdenv, fetchFromGitHub, fetchpatch +, meson, ninja +, pkgconfig, scdoc +, wayland, libxkbcommon, pcre, json_c, dbus, libevdev +, pango, cairo, libinput, libcap, pam, gdk_pixbuf +, wlroots, wayland-protocols , buildDocs ? true }: stdenv.mkDerivation rec { - name = "sway-${version}"; - version = "0.15.2"; + name = "${pname}-${version}"; + pname = "sway"; + version = "1.0"; src = fetchFromGitHub { owner = "swaywm"; repo = "sway"; rev = version; - sha256 = "1p9j5gv85lsgj4z28qja07dqyvqk41w6mlaflvvm9yxafx477g5n"; + sha256 = "09cndc2nl39d3l7g5634xp0pxcz60pvc5277mfw89r22mh0j78rx"; }; + patches = [ + # Fix for a compiler warning that causes a build failure + # (see https://github.com/swaywm/sway/issues/3862): + (fetchpatch { + url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch"; + sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp"; + }) + ]; + nativeBuildInputs = [ - cmake pkgconfig - ] ++ stdenv.lib.optional buildDocs [ asciidoc libxslt docbook_xsl ]; + pkgconfig meson ninja + ] ++ stdenv.lib.optional buildDocs scdoc; + buildInputs = [ - wayland wlc libxkbcommon pcre json_c dbus - pango cairo libinput libcap pam gdk_pixbuf libpthreadstubs - libXdmcp + wayland libxkbcommon pcre json_c dbus libevdev + pango cairo libinput libcap pam gdk_pixbuf + wlroots wayland-protocols ]; enableParallelBuilding = true; - cmakeFlags = "-DVERSION=${version} -DLD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib"; + mesonFlags = [ + "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled" "-Dtray=enabled" + ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled"; meta = with stdenv.lib; { description = "i3-compatible window manager for Wayland"; homepage = https://swaywm.org; license = licenses.mit; platforms = platforms.linux; - maintainers = with maintainers; [ primeos ]; # Trying to keep it up-to-date. + maintainers = with maintainers; [ primeos synthetica ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e4e345545207..f230bc367b8f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17712,7 +17712,6 @@ in orbment = callPackage ../applications/window-managers/orbment { }; sway = callPackage ../applications/window-managers/sway { }; - sway-beta = callPackage ../applications/window-managers/sway/beta.nix { }; swayidle = callPackage ../applications/window-managers/sway/idle.nix { }; swaylock = callPackage ../applications/window-managers/sway/lock.nix { }; |