31 # Used by the NixOS module:
33 enableXWayland ? true,
34 systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
35 trayEnabled ? systemdSupport,
38 stdenv.mkDerivation (finalAttrs: {
46 pname = "swayfx-unwrapped";
49 src = fetchFromGitHub {
50 owner = "WillPower3309";
52 rev = "refs/tags/${finalAttrs.version}";
53 hash = "sha256-VT+JjQPqCIdtaLeSnRiZ3rES0KgDJR7j5Byxr+d6oRg=";
58 ./load-configuration-from-etc.patch
61 src = ./fix-paths.patch;
65 ++ lib.optionals (!finalAttrs.isNixOS) [
66 # References to /nix/store/... will get GC'ed which causes problems when
67 # copying the default configuration:
68 ./sway-config-no-nix-store-references.patch
70 ++ lib.optionals finalAttrs.isNixOS [
71 # Use /run/current-system/sw/share and /etc instead of /nix/store
73 ./sway-config-nixos-paths.patch
77 depsBuildBuild = [ pkg-config ];
102 (wlroots.override { inherit (finalAttrs) enableXWayland; })
103 ] ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ];
107 inherit (lib.strings) mesonEnable mesonOption;
109 # The "sd-bus-provider" meson option does not include a "none" option,
110 # but it is silently ignored iff "-Dtray=disabled". We use "basu"
111 # (which is not in nixpkgs) instead of "none" to alert us if this
112 # changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761
113 # assert trayEnabled -> systemdSupport && dbusSupport;
115 sd-bus-provider = if systemdSupport then "libsystemd" else "basu";
118 (mesonOption "sd-bus-provider" sd-bus-provider)
119 (mesonEnable "xwayland" finalAttrs.enableXWayland)
120 (mesonEnable "tray" finalAttrs.trayEnabled)
125 basic = nixosTests.swayfx;
126 version = testers.testVersion {
127 package = finalAttrs.finalPackage;
128 command = "sway --version";
129 version = "swayfx version ${finalAttrs.version}";
135 description = "Sway, but with eye candy!";
136 homepage = "https://github.com/WillPower3309/swayfx";
137 changelog = "https://github.com/WillPower3309/swayfx/releases/tag/${finalAttrs.version}";
138 license = lib.licenses.mit;
139 maintainers = with lib.maintainers; [
143 platforms = lib.platforms.linux;
144 mainProgram = "sway";
147 Fork of Sway, an incredible and one of the most well established Wayland
148 compositors, and a drop-in replacement for the i3 window manager for X11.
149 SwayFX adds extra options and effects to the original Sway, such as rounded corners,
150 shadows and inactive window dimming to bring back some of the Picom X11
151 compositor functionality, which was commonly used with the i3 window manager.