sway: Switch to 1.0

This is the result of executing:
git mv -f pkgs/applications/window-managers/sway/beta.nix pkgs/applications/window-managers/sway/default.nix
git mv -f nixos/modules/programs/sway-beta.nix nixos/modules/programs/sway.nix

And removing sway-beta from the following files:
pkgs/top-level/all-packages.nix
nixos/modules/module-list.nix

+59 -193
-1
nixos/modules/module-list.nix
··· 129 129 ./programs/sysdig.nix 130 130 ./programs/systemtap.nix 131 131 ./programs/sway.nix 132 - ./programs/sway-beta.nix 133 132 ./programs/thefuck.nix 134 133 ./programs/tmux.nix 135 134 ./programs/udevil.nix
-91
nixos/modules/programs/sway-beta.nix
··· 1 - { config, pkgs, lib, ... }: 2 - 3 - with lib; 4 - 5 - let 6 - cfg = config.programs.sway-beta; 7 - swayPackage = cfg.package; 8 - 9 - swayWrapped = pkgs.writeShellScriptBin "sway" '' 10 - set -o errexit 11 - 12 - if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then 13 - export _SWAY_WRAPPER_ALREADY_EXECUTED=1 14 - ${cfg.extraSessionCommands} 15 - fi 16 - 17 - if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then 18 - export DBUS_SESSION_BUS_ADDRESS 19 - exec ${swayPackage}/bin/sway "$@" 20 - else 21 - exec ${pkgs.dbus}/bin/dbus-run-session ${swayPackage}/bin/sway "$@" 22 - fi 23 - ''; 24 - swayJoined = pkgs.symlinkJoin { 25 - name = "sway-joined"; 26 - paths = [ swayWrapped swayPackage ]; 27 - }; 28 - in { 29 - options.programs.sway-beta = { 30 - enable = mkEnableOption '' 31 - Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 32 - ''; 33 - 34 - package = mkOption { 35 - type = types.package; 36 - default = pkgs.sway-beta; 37 - defaultText = "pkgs.sway-beta"; 38 - description = '' 39 - The package to be used for `sway`. 40 - ''; 41 - }; 42 - 43 - extraSessionCommands = mkOption { 44 - type = types.lines; 45 - default = ""; 46 - example = '' 47 - export SDL_VIDEODRIVER=wayland 48 - # needs qt5.qtwayland in systemPackages 49 - export QT_QPA_PLATFORM=wayland 50 - export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" 51 - # Fix for some Java AWT applications (e.g. Android Studio), 52 - # use this if they aren't displayed properly: 53 - export _JAVA_AWT_WM_NONREPARENTING=1 54 - ''; 55 - description = '' 56 - Shell commands executed just before Sway is started. 57 - ''; 58 - }; 59 - 60 - extraPackages = mkOption { 61 - type = with types; listOf package; 62 - default = with pkgs; [ 63 - swaylock swayidle 64 - xwayland rxvt_unicode dmenu 65 - ]; 66 - defaultText = literalExample '' 67 - with pkgs; [ swaylock swayidle xwayland rxvt_unicode dmenu ]; 68 - ''; 69 - example = literalExample '' 70 - with pkgs; [ 71 - xwayland 72 - i3status i3status-rust 73 - termite rofi light 74 - ] 75 - ''; 76 - description = '' 77 - Extra packages to be installed system wide. 78 - ''; 79 - }; 80 - }; 81 - 82 - config = mkIf cfg.enable { 83 - environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; 84 - security.pam.services.swaylock = {}; 85 - hardware.opengl.enable = mkDefault true; 86 - fonts.enableDefaultFonts = mkDefault true; 87 - programs.dconf.enable = mkDefault true; 88 - }; 89 - 90 - meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ]; 91 - }
+30 -31
nixos/modules/programs/sway.nix
··· 3 3 with lib; 4 4 5 5 let 6 - cfg = config.programs.sway; 7 - swayPackage = pkgs.sway; 6 + cfg = config.programs.sway-beta; 7 + swayPackage = cfg.package; 8 8 9 9 swayWrapped = pkgs.writeShellScriptBin "sway" '' 10 10 set -o errexit ··· 16 16 17 17 if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then 18 18 export DBUS_SESSION_BUS_ADDRESS 19 - exec sway-setcap "$@" 19 + exec ${swayPackage}/bin/sway "$@" 20 20 else 21 - exec ${pkgs.dbus}/bin/dbus-run-session sway-setcap "$@" 21 + exec ${pkgs.dbus}/bin/dbus-run-session ${swayPackage}/bin/sway "$@" 22 22 fi 23 23 ''; 24 24 swayJoined = pkgs.symlinkJoin { ··· 26 26 paths = [ swayWrapped swayPackage ]; 27 27 }; 28 28 in { 29 - options.programs.sway = { 29 + options.programs.sway-beta = { 30 30 enable = mkEnableOption '' 31 - the tiling Wayland compositor Sway. After adding yourself to the "sway" 32 - group you can manually launch Sway by executing "sway" from a terminal. 33 - If you call "sway" with any parameters the extraSessionCommands won't be 34 - executed and Sway won't be launched with dbus-launch''; 31 + Sway, the i3-compatible tiling Wayland compositor. This module will be removed after the final release of Sway 1.0 32 + ''; 33 + 34 + package = mkOption { 35 + type = types.package; 36 + default = pkgs.sway-beta; 37 + defaultText = "pkgs.sway-beta"; 38 + description = '' 39 + The package to be used for `sway`. 40 + ''; 41 + }; 35 42 36 43 extraSessionCommands = mkOption { 37 44 type = types.lines; 38 45 default = ""; 39 46 example = '' 40 - # Define a keymap (US QWERTY is the default) 41 - export XKB_DEFAULT_LAYOUT=de,us 42 - export XKB_DEFAULT_VARIANT=nodeadkeys 43 - export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle,caps:escape 44 - # Change the Keyboard repeat delay and rate 45 - export WLC_REPEAT_DELAY=660 46 - export WLC_REPEAT_RATE=25 47 + export SDL_VIDEODRIVER=wayland 48 + # needs qt5.qtwayland in systemPackages 49 + export QT_QPA_PLATFORM=wayland 50 + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" 51 + # Fix for some Java AWT applications (e.g. Android Studio), 52 + # use this if they aren't displayed properly: 53 + export _JAVA_AWT_WM_NONREPARENTING=1 47 54 ''; 48 55 description = '' 49 56 Shell commands executed just before Sway is started. ··· 53 60 extraPackages = mkOption { 54 61 type = with types; listOf package; 55 62 default = with pkgs; [ 56 - i3status xwayland rxvt_unicode dmenu 63 + swaylock swayidle 64 + xwayland rxvt_unicode dmenu 57 65 ]; 58 66 defaultText = literalExample '' 59 - with pkgs; [ i3status xwayland rxvt_unicode dmenu ]; 67 + with pkgs; [ swaylock swayidle xwayland rxvt_unicode dmenu ]; 60 68 ''; 61 69 example = literalExample '' 62 70 with pkgs; [ 63 - i3lock light termite 71 + xwayland 72 + i3status i3status-rust 73 + termite rofi light 64 74 ] 65 75 ''; 66 76 description = '' ··· 71 81 72 82 config = mkIf cfg.enable { 73 83 environment.systemPackages = [ swayJoined ] ++ cfg.extraPackages; 74 - security.wrappers.sway = { 75 - program = "sway-setcap"; 76 - source = "${swayPackage}/bin/sway"; 77 - capabilities = "cap_sys_ptrace,cap_sys_tty_config=eip"; 78 - owner = "root"; 79 - group = "sway"; 80 - permissions = "u+rx,g+rx"; 81 - }; 82 - 83 - users.groups.sway = {}; 84 84 security.pam.services.swaylock = {}; 85 - 86 85 hardware.opengl.enable = mkDefault true; 87 86 fonts.enableDefaultFonts = mkDefault true; 88 87 programs.dconf.enable = mkDefault true; 89 88 }; 90 89 91 - meta.maintainers = with lib.maintainers; [ gnidorah primeos ]; 90 + meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ]; 92 91 }
-54
pkgs/applications/window-managers/sway/beta.nix
··· 1 - { stdenv, fetchFromGitHub, fetchpatch 2 - , meson, ninja 3 - , pkgconfig, scdoc 4 - , wayland, libxkbcommon, pcre, json_c, dbus, libevdev 5 - , pango, cairo, libinput, libcap, pam, gdk_pixbuf 6 - , wlroots, wayland-protocols 7 - , buildDocs ? true 8 - }: 9 - 10 - stdenv.mkDerivation rec { 11 - name = "${pname}-${version}"; 12 - pname = "sway"; 13 - version = "1.0"; 14 - 15 - src = fetchFromGitHub { 16 - owner = "swaywm"; 17 - repo = "sway"; 18 - rev = version; 19 - sha256 = "09cndc2nl39d3l7g5634xp0pxcz60pvc5277mfw89r22mh0j78rx"; 20 - }; 21 - 22 - patches = [ 23 - # Fix for a compiler warning that causes a build failure 24 - # (see https://github.com/swaywm/sway/issues/3862): 25 - (fetchpatch { 26 - url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch"; 27 - sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp"; 28 - }) 29 - ]; 30 - 31 - nativeBuildInputs = [ 32 - pkgconfig meson ninja 33 - ] ++ stdenv.lib.optional buildDocs scdoc; 34 - 35 - buildInputs = [ 36 - wayland libxkbcommon pcre json_c dbus libevdev 37 - pango cairo libinput libcap pam gdk_pixbuf 38 - wlroots wayland-protocols 39 - ]; 40 - 41 - enableParallelBuilding = true; 42 - 43 - mesonFlags = [ 44 - "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled" "-Dtray=enabled" 45 - ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled"; 46 - 47 - meta = with stdenv.lib; { 48 - description = "i3-compatible window manager for Wayland"; 49 - homepage = https://swaywm.org; 50 - license = licenses.mit; 51 - platforms = platforms.linux; 52 - maintainers = with maintainers; [ primeos synthetica ]; 53 - }; 54 - }
+29 -15
pkgs/applications/window-managers/sway/default.nix
··· 1 - { stdenv, fetchFromGitHub 2 - , cmake, pkgconfig, asciidoc, libxslt, docbook_xsl 3 - , wayland, wlc, libxkbcommon, pcre, json_c, dbus 4 - , pango, cairo, libinput, libcap, pam, gdk_pixbuf, libpthreadstubs 5 - , libXdmcp 1 + { stdenv, fetchFromGitHub, fetchpatch 2 + , meson, ninja 3 + , pkgconfig, scdoc 4 + , wayland, libxkbcommon, pcre, json_c, dbus, libevdev 5 + , pango, cairo, libinput, libcap, pam, gdk_pixbuf 6 + , wlroots, wayland-protocols 6 7 , buildDocs ? true 7 8 }: 8 9 9 10 stdenv.mkDerivation rec { 10 - name = "sway-${version}"; 11 - version = "0.15.2"; 11 + name = "${pname}-${version}"; 12 + pname = "sway"; 13 + version = "1.0"; 12 14 13 15 src = fetchFromGitHub { 14 16 owner = "swaywm"; 15 17 repo = "sway"; 16 18 rev = version; 17 - sha256 = "1p9j5gv85lsgj4z28qja07dqyvqk41w6mlaflvvm9yxafx477g5n"; 19 + sha256 = "09cndc2nl39d3l7g5634xp0pxcz60pvc5277mfw89r22mh0j78rx"; 18 20 }; 19 21 22 + patches = [ 23 + # Fix for a compiler warning that causes a build failure 24 + # (see https://github.com/swaywm/sway/issues/3862): 25 + (fetchpatch { 26 + url = "https://github.com/swaywm/sway/commit/bcde298a719f60b9913133dbd2a169dedbc8dd7d.patch"; 27 + sha256 = "0r583nmqvq43ib93yv6flw8pj833v32lbs0q0xld56s3rnzvvdcp"; 28 + }) 29 + ]; 30 + 20 31 nativeBuildInputs = [ 21 - cmake pkgconfig 22 - ] ++ stdenv.lib.optional buildDocs [ asciidoc libxslt docbook_xsl ]; 32 + pkgconfig meson ninja 33 + ] ++ stdenv.lib.optional buildDocs scdoc; 34 + 23 35 buildInputs = [ 24 - wayland wlc libxkbcommon pcre json_c dbus 25 - pango cairo libinput libcap pam gdk_pixbuf libpthreadstubs 26 - libXdmcp 36 + wayland libxkbcommon pcre json_c dbus libevdev 37 + pango cairo libinput libcap pam gdk_pixbuf 38 + wlroots wayland-protocols 27 39 ]; 28 40 29 41 enableParallelBuilding = true; 30 42 31 - cmakeFlags = "-DVERSION=${version} -DLD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib"; 43 + mesonFlags = [ 44 + "-Dxwayland=enabled" "-Dgdk-pixbuf=enabled" "-Dtray=enabled" 45 + ] ++ stdenv.lib.optional buildDocs "-Dman-pages=enabled"; 32 46 33 47 meta = with stdenv.lib; { 34 48 description = "i3-compatible window manager for Wayland"; 35 49 homepage = https://swaywm.org; 36 50 license = licenses.mit; 37 51 platforms = platforms.linux; 38 - maintainers = with maintainers; [ primeos ]; # Trying to keep it up-to-date. 52 + maintainers = with maintainers; [ primeos synthetica ]; 39 53 }; 40 54 }
-1
pkgs/top-level/all-packages.nix
··· 17712 17712 orbment = callPackage ../applications/window-managers/orbment { }; 17713 17713 17714 17714 sway = callPackage ../applications/window-managers/sway { }; 17715 - sway-beta = callPackage ../applications/window-managers/sway/beta.nix { }; 17716 17715 swayidle = callPackage ../applications/window-managers/sway/idle.nix { }; 17717 17716 swaylock = callPackage ../applications/window-managers/sway/lock.nix { }; 17718 17717