From db997037d737da4493544a5b1034aaa43fc20d30 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 19 Feb 2022 15:04:05 -0800 Subject: swayidle: honor systemdSupport This commit exposes support for compilation without systemd, controlled by the global systemdSupport argument. This argument is understood by many other nixpkgs expressions and can be set globally in ~/.config/nixpkgs/config.nix. --- pkgs/applications/window-managers/sway/idle.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs/applications/window-managers') diff --git a/pkgs/applications/window-managers/sway/idle.nix b/pkgs/applications/window-managers/sway/idle.nix index fd424e3074a7..0928fbcfb4ef 100644 --- a/pkgs/applications/window-managers/sway/idle.nix +++ b/pkgs/applications/window-managers/sway/idle.nix @@ -1,6 +1,7 @@ { lib, stdenv, fetchFromGitHub , meson, ninja, pkg-config, scdoc, wayland-scanner -, wayland, wayland-protocols, systemd +, wayland, wayland-protocols +, systemdSupport ? stdenv.isLinux, systemd }: stdenv.mkDerivation rec { @@ -15,9 +16,10 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ]; - buildInputs = [ wayland wayland-protocols systemd ]; + buildInputs = [ wayland wayland-protocols ] + ++ lib.optionals systemdSupport [ systemd ]; - mesonFlags = [ "-Dman-pages=enabled" "-Dlogind=enabled" ]; + mesonFlags = [ "-Dman-pages=enabled" "-Dlogind=${if systemdSupport then "enabled" else "disabled"}" ]; meta = with lib; { description = "Idle management daemon for Wayland"; -- cgit 1.4.1