mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
143 lines
3.1 KiB
Nix
143 lines
3.1 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, stdenv
|
|
, systemd
|
|
, meson
|
|
, replaceVars
|
|
, swaybg
|
|
, ninja
|
|
, pkg-config
|
|
, gdk-pixbuf
|
|
, librsvg
|
|
, wayland-protocols
|
|
, libdrm
|
|
, libinput
|
|
, cairo
|
|
, pango
|
|
, wayland
|
|
, libGL
|
|
, libxkbcommon
|
|
, pcre2
|
|
, cmake
|
|
, json_c
|
|
, libevdev
|
|
, scdoc
|
|
, scenefx
|
|
, wayland-scanner
|
|
, xcbutilwm
|
|
, wlroots_0_18
|
|
, testers
|
|
, nixosTests
|
|
, # Used by the NixOS module:
|
|
isNixOS ? false
|
|
, enableXWayland ? true
|
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
|
|
, trayEnabled ? systemdSupport
|
|
, ...
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
inherit
|
|
enableXWayland
|
|
isNixOS
|
|
systemdSupport
|
|
trayEnabled
|
|
;
|
|
|
|
pname = "swayfx-unwrapped";
|
|
version = "0.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "WillPower3309";
|
|
repo = "swayfx";
|
|
tag = "0.5";
|
|
hash = "sha256-gdab7zkjp/S7YVCP1t/OfOdUXZRwNvNSuRFGWEJScF8=";
|
|
};
|
|
|
|
patches =
|
|
[
|
|
./load-configuration-from-etc.patch
|
|
|
|
(replaceVars ./fix-paths.patch {
|
|
inherit swaybg;
|
|
})
|
|
];
|
|
|
|
strictDeps = true;
|
|
depsBuildBuild = [ pkg-config ];
|
|
|
|
nativeBuildInputs = [
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
scdoc
|
|
wayland-scanner
|
|
cmake
|
|
];
|
|
|
|
buildInputs = [
|
|
cairo
|
|
gdk-pixbuf
|
|
json_c
|
|
libdrm
|
|
libevdev
|
|
libGL
|
|
libinput
|
|
librsvg
|
|
libxkbcommon
|
|
pango
|
|
pcre2
|
|
scenefx
|
|
wayland
|
|
wayland-protocols
|
|
(wlroots_0_18.override { inherit (finalAttrs) enableXWayland; })
|
|
] ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ];
|
|
|
|
mesonFlags =
|
|
let
|
|
inherit (lib.strings) mesonEnable mesonOption;
|
|
|
|
# The "sd-bus-provider" meson option does not include a "none" option,
|
|
# but it is silently ignored iff "-Dtray=disabled". We use "basu"
|
|
# (which is not in nixpkgs) instead of "none" to alert us if this
|
|
# changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761
|
|
# assert trayEnabled -> systemdSupport && dbusSupport;
|
|
|
|
sd-bus-provider = if systemdSupport then "libsystemd" else "basu";
|
|
in
|
|
[
|
|
(mesonOption "sd-bus-provider" sd-bus-provider)
|
|
(mesonEnable "tray" finalAttrs.trayEnabled)
|
|
];
|
|
|
|
passthru = {
|
|
tests = {
|
|
basic = nixosTests.swayfx;
|
|
version = testers.testVersion {
|
|
package = finalAttrs.finalPackage;
|
|
command = "sway --version";
|
|
version = "swayfx version ${finalAttrs.version}";
|
|
};
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
description = "Sway, but with eye candy!";
|
|
homepage = "https://github.com/WillPower3309/swayfx";
|
|
changelog = "https://github.com/WillPower3309/swayfx/releases/tag/${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
ricarch97
|
|
];
|
|
platforms = lib.platforms.linux;
|
|
mainProgram = "sway";
|
|
|
|
longDescription = ''
|
|
Fork of Sway, an incredible and one of the most well established Wayland
|
|
compositors, and a drop-in replacement for the i3 window manager for X11.
|
|
SwayFX adds extra options and effects to the original Sway, such as rounded corners,
|
|
shadows and inactive window dimming to bring back some of the Picom X11
|
|
compositor functionality, which was commonly used with the i3 window manager.
|
|
'';
|
|
};
|
|
})
|