Skip to content

Commit

Permalink
Merge pull request #192197 from amjoseph-nixpkgs/pr/system/isSystemd
Browse files Browse the repository at this point in the history
treewide: systemdSupport: use lib.meta.availableOn
  • Loading branch information
flokli authored Jan 22, 2023
2 parents 2878ebb + 42815b4 commit d99d2ce
Show file tree
Hide file tree
Showing 44 changed files with 59 additions and 53 deletions.
7 changes: 6 additions & 1 deletion lib/meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ rec {
2. (modern) a pattern for the platform `parsed` field.
3. (functional) a predicate function returning a boolean.
We can inject these into a pattern for the whole of a structured platform,
and then match that.
*/
platformMatch = platform: elem: let
platformMatch = platform: elem:
if builtins.isFunction elem
then elem platform
else let
pattern =
if builtins.isString elem
then { system = elem; }
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/audio/musikcube/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ cmake
{ lib
, stdenv
, cmake
, pkg-config
, boost
, curl
Expand All @@ -12,13 +14,11 @@
, libopenmpt
, mpg123
, ncurses
, lib
, stdenv
, taglib
# Linux Dependencies
, alsa-lib
, pulseaudio
, systemdSupport ? stdenv.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
# Darwin Dependencies
, Cocoa
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/emacs/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
else if withMotif then "motif"
else if withAthena then "athena"
else "lucid")
, withSystemd ? stdenv.isLinux, systemd
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:

assert (libXft != null) -> libpng != null; # probably a bug
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/graphics/drawpile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# optional server deps
, libmicrohttpd
, libsodium
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd ? null

# options
Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/misc/prusa-slicer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
, openvdb
, pcre
, qhull
, systemd
, tbb
, wxGTK31
, xorg
, fetchpatch
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:
let
wxGTK-prusa = wxGTK31.overrideAttrs (old: rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/seatd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, pkg-config
, scdoc
, stdenv
, systemdSupport ? stdenv.isLinux, systemd
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:

stdenv.mkDerivation rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
, ungoogled ? false, ungoogled-chromium
# Optional dependencies:
, libgcrypt ? null # cupsSupport
, systemdSupport ? stdenv.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/msmtp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
, Security
, withKeyring ? true
, libsecret
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/p2p/transmission/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
, enableQt ? false
, qt5
, nixosTests
, enableSystemd ? stdenv.isLinux
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, enableDaemon ? true
, enableCli ? true
, installLib ? false
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/sync/onedrive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, curl
, sqlite
, libnotify
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/virtualization/docker/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rec {
, iptables, e2fsprogs, xz, util-linux, xfsprogs, git
, procps, rootlesskit, slirp4netns, fuse-overlayfs, nixosTests
, clientOnly ? !stdenv.isLinux, symlinkJoin
, withSystemd ? stdenv.isLinux, systemd
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, withBtrfs ? stdenv.isLinux, btrfs-progs
, withLvm ? stdenv.isLinux, lvm2
, withSeccomp ? stdenv.isLinux, libseccomp
Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/window-managers/sway/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
, nixosTests
# Used by the NixOS module:
, isNixOS ? false

, enableXWayland ? true, xorg
, systemdSupport ? stdenv.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, dbusSupport ? true
, dbus
, trayEnabled ? systemdSupport && dbusSupport
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/window-managers/sway/idle.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchFromGitHub
, meson, ninja, pkg-config, scdoc, wayland-scanner
, wayland, wayland-protocols, runtimeShell
, systemdSupport ? stdenv.isLinux, systemd
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:

stdenv.mkDerivation rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/erlang/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
, parallelBuild ? false
, systemd
, wxSupport ? true
, systemdSupport ? stdenv.isLinux # systemd support in epmd
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd # systemd support in epmd
# updateScript deps
, writeScript
, common-updater-scripts
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/interpreters/php/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let
, cgotoSupport ? false
, embedSupport ? false
, ipv6Support ? true
, systemdSupport ? stdenv.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, valgrindSupport ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
, ztsSupport ? apxs2Support
}@args:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/dbus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, fetchurl
, pkg-config
, expat
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
, systemdMinimal
, audit
, libapparmor
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/polkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
, docbook_xml_dtd_412
, gtk-doc
, coreutils
, useSystemd ? stdenv.isLinux
, useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
, systemdMinimal
, elogind
# A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/vte/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
, zlib
, icu
, systemd
, systemdSupport ? stdenv.hostPlatform.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, nixosTests
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/webkitgtk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
, addOpenGLRunpath
, enableGeoLocation ? true
, withLibsecret ? true
, systemdSupport ? stdenv.isLinux
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
}:

stdenv.mkDerivation (finalAttrs: {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/yder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, systemd
, check
, subunit
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
}:

stdenv.mkDerivation rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/cups/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
, libtiff
, pam
, dbus
, enableSystemd ? stdenv.isLinux
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
, acl
, gmp
Expand Down
2 changes: 1 addition & 1 deletion pkgs/misc/screensavers/xscreensaver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, gtk2, gdk-pixbuf, gdk-pixbuf-xlib, libxml2, pam
, systemd, coreutils
, forceInstallAllHacks ? false
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
}:

stdenv.mkDerivation rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/linux/procps-ng/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# `ps` with systemd support is able to properly report different
# attributes like unit name, so we want to have it on linux.
, withSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd

# procps is mostly Linux-only. Most commands require a running Linux
Expand Down
1 change: 1 addition & 0 deletions pkgs/os-specific/linux/systemd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ stdenv.mkDerivation {
description = "A system and service manager for Linux";
license = licenses.lgpl21Plus;
platforms = platforms.linux;
badPlatforms = [ (plat: plat.isStatic) ];
# https://github.com/systemd/systemd/issues/20600#issuecomment-912338965
broken = stdenv.hostPlatform.isStatic;
priority = 10;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/os-specific/linux/util-linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, ncurses
, pamSupport ? true
, pam
, systemdSupport ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
, nlsSupport ? true
, translateManpages ? true
Expand Down
3 changes: 1 addition & 2 deletions pkgs/servers/ldap/389/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
, python3
, rustPlatform
, openssl
, systemd
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, zlib
, rsync
, withCockpit ? true
Expand Down
3 changes: 2 additions & 1 deletion pkgs/servers/matrix-synapse/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib, stdenv, fetchFromGitHub, python3, openssl, rustPlatform
, enableSystemd ? stdenv.isLinux, nixosTests
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, nixosTests
, enableRedis ? true
, callPackage
}:
Expand Down
7 changes: 4 additions & 3 deletions pkgs/servers/mautrix-facebook/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{ enableSystemd ? stdenv.isLinux
{ lib
, stdenv
, systemd
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, fetchFromGitHub
, fetchpatch
, lib
, python3
, stdenv
}:

python3.pkgs.buildPythonPackage rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/mqtt/mosquitto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
, libuv
, libwebsockets
, openssl
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
, fetchpatch
}:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/nfd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
, systemd
, wafHook
, websocketpp
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, withWebSocket ? true
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/nosql/redis/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchurl, lua, pkg-config, nixosTests
, tcl, which, ps, getconf
, withSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic, systemd
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
# dependency ordering is broken at the moment when building with openssl
, tlsSupport ? !stdenv.hostPlatform.isStatic, openssl
}:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/pulseaudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

, x11Support ? false

, useSystemd ? stdenv.isLinux
, useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd

, # Whether to support the JACK sound system as a backend.
jackaudioSupport ? false
Expand Down
2 changes: 1 addition & 1 deletion pkgs/servers/uwsgi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# plugins: list of strings, eg. [ "python2" "python3" ]
, plugins ? []
, pam, withPAM ? stdenv.isLinux
, systemd, withSystemd ? stdenv.isLinux
, systemd, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, libcap, withCap ? stdenv.isLinux
, python2, python3, ncurses
, ruby, php
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/generic/check-meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ let
sourceProvenance = listOf lib.types.attrs;
maintainers = listOf (attrsOf anything); # TODO use the maintainer type from lib/tests/maintainer-module.nix
priority = int;
platforms = listOf (either str (attrsOf anything)); # see lib.meta.platformMatch
platforms = listOf (oneOf [ str (attrsOf anything) (functionTo bool) ]); # see lib.meta.platformMatch
hydraPlatforms = listOf str;
broken = bool;
unfree = bool;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/misc/brltty/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl, pkg-config, python3, bluez
, tcl, acl, kmod, coreutils, shadow, util-linux, udev
, alsaSupport ? stdenv.isLinux, alsa-lib
, systemdSupport ? stdenv.isLinux, systemd
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
}:

stdenv.mkDerivation rec {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/misc/tmux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, libevent
, ncurses
, pkg-config
, withSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic, systemd
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
, withUtf8proc ? true, utf8proc # gets Unicode updates faster than glibc
, withUtempter ? stdenv.isLinux && !stdenv.hostPlatform.isMusl, libutempter
}:
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/networking/dd-agent/datadog-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, pkg-config
, systemd
, hostname
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, extraTags ? [ ]
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/networking/openfortivpn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, openssl
, ppp
, systemd
, withSystemd ? stdenv.isLinux
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, withPpp ? stdenv.isLinux
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/networking/openvpn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, openssl
, openssl_1_1
, pam
, useSystemd ? stdenv.isLinux
, useSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
, update-systemd-resolved
, util-linux
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/package-management/packagekit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
, enableCommandNotFound ? false
, enableBashCompletion ? false
, bash-completion ? null
, enableSystemd ? stdenv.isLinux
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
}:

Expand Down
Loading

0 comments on commit d99d2ce

Please sign in to comment.