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.
This commit is contained in:
Adam Joseph 2022-02-19 15:04:05 -08:00
parent 65c8149cb1
commit db997037d7

View File

@ -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";