sway: remove with lib;

This commit is contained in:
éclairevoyant 2024-03-28 09:18:49 -04:00
parent 56cfc87a73
commit 3513704e13
No known key found for this signature in database
GPG Key ID: E3813AEAA02DB54B

View File

@ -13,9 +13,12 @@
assert extraSessionCommands != "" -> withBaseWrapper; assert extraSessionCommands != "" -> withBaseWrapper;
with lib;
let let
inherit (builtins) replaceStrings;
inherit (lib.lists) optional optionals;
inherit (lib.meta) getExe;
inherit (lib.strings) concatMapStrings optionalString;
sway = sway-unwrapped.overrideAttrs (oa: { inherit isNixOS enableXWayland; }); sway = sway-unwrapped.overrideAttrs (oa: { inherit isNixOS enableXWayland; });
baseWrapper = writeShellScriptBin sway.meta.mainProgram '' baseWrapper = writeShellScriptBin sway.meta.mainProgram ''
set -o errexit set -o errexit
@ -26,13 +29,13 @@ let
fi fi
if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then
export DBUS_SESSION_BUS_ADDRESS export DBUS_SESSION_BUS_ADDRESS
exec ${lib.getExe sway} "$@" exec ${getExe sway} "$@"
else else
exec ${lib.optionalString dbusSupport "${dbus}/bin/dbus-run-session"} ${lib.getExe sway} "$@" exec ${optionalString dbusSupport "${dbus}/bin/dbus-run-session"} ${getExe sway} "$@"
fi fi
''; '';
in symlinkJoin rec { in symlinkJoin rec {
pname = lib.replaceStrings ["-unwrapped"] [""] sway.pname; pname = replaceStrings ["-unwrapped"] [""] sway.pname;
inherit (sway) version; inherit (sway) version;
name = "${pname}-${version}"; name = "${pname}-${version}";