summary refs log tree commit diff
path: root/pkgs/applications/window-managers/sway/wrapper.nix
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2021-05-14 16:32:43 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2021-05-14 16:32:43 +1000
commit004f8cd986ca6e8bcad1a71419f6a53bd89fed73 (patch)
tree0818ebbec8b74ffe1e933325f45311bc935a0f44 /pkgs/applications/window-managers/sway/wrapper.nix
parent76c58493d78d5f06ed62e0b8309f223232dfc309 (diff)
parentbfb5f4cc5e5c0914eb2cafe082d9521904025b43 (diff)
downloadnixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar.gz
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar.bz2
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar.lz
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar.xz
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.tar.zst
nixpkgs-004f8cd986ca6e8bcad1a71419f6a53bd89fed73.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/applications/window-managers/sway/wrapper.nix')
-rw-r--r--pkgs/applications/window-managers/sway/wrapper.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/applications/window-managers/sway/wrapper.nix b/pkgs/applications/window-managers/sway/wrapper.nix
index 964828fdaba..07459295d75 100644
--- a/pkgs/applications/window-managers/sway/wrapper.nix
+++ b/pkgs/applications/window-managers/sway/wrapper.nix
@@ -4,6 +4,8 @@
 , withBaseWrapper ? true, extraSessionCommands ? "", dbus
 , withGtkWrapper ? false, wrapGAppsHook, gdk-pixbuf, glib, gtk3
 , extraOptions ? [] # E.g.: [ "--verbose" ]
+# Used by the NixOS module:
+, isNixOS ? false
 }:
 
 assert extraSessionCommands != "" -> withBaseWrapper;
@@ -11,6 +13,7 @@ assert extraSessionCommands != "" -> withBaseWrapper;
 with lib;
 
 let
+  sway = sway-unwrapped.override { inherit isNixOS; };
   baseWrapper = writeShellScriptBin "sway" ''
      set -o errexit
      if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then
@@ -20,16 +23,16 @@ let
      fi
      if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then
        export DBUS_SESSION_BUS_ADDRESS
-       exec ${sway-unwrapped}/bin/sway "$@"
+       exec ${sway}/bin/sway "$@"
      else
-       exec ${dbus}/bin/dbus-run-session ${sway-unwrapped}/bin/sway "$@"
+       exec ${dbus}/bin/dbus-run-session ${sway}/bin/sway "$@"
      fi
    '';
 in symlinkJoin {
-  name = "sway-${sway-unwrapped.version}";
+  name = "sway-${sway.version}";
 
   paths = (optional withBaseWrapper baseWrapper)
-    ++ [ sway-unwrapped ];
+    ++ [ sway ];
 
   nativeBuildInputs = [ makeWrapper ]
     ++ (optional withGtkWrapper wrapGAppsHook);
@@ -49,5 +52,5 @@ in symlinkJoin {
 
   passthru.providedSessions = [ "sway" ];
 
-  inherit (sway-unwrapped) meta;
+  inherit (sway) meta;
 }