Many packages have some kind of flag indicating whether or not to build with
systemd support. Most of these default to `stdenv.isLinux`, but systemd does
not build on (and is marked `broken` for) `isStatic`. Only a few packages have
the needed `&& !isStatic` in the default value for their parameter.
This commit moves the logic for the default value of these flags into
`systemd.meta.{platforms,badPlatforms}` and evaluates those conditions using
`lib.meta.availableOn`.
This provides three benefits:
1. The default values are set correctly (i.e. including `&& isStatic`)
2. The default values are set consistently
3. The way is paved for any future non-Linux systemd platforms (FreeBSD is
reported to have experimental systemd support)
Since 31ac354cbe,
bubblewrap gets called the following way on NixOS system,
when it has `share/fonts` in `environment.pathsToLink`:
$ bwrap --ro-bind /nix/store /nix/store --ro-bind /run/current-system /run/current-system --ro-bind-try /run/current-system/sw/share/fonts /run/current-system/sw/share/fonts -- $(realpath $(which true))
bwrap: Can't mkdir parents for /run/current-system/sw/share/fonts: No such file or directory
It fails because `/run/current-system/sw` is a symlink
so bubblewrap is not be able to add another mountpoint inside.
Ideally, we would remove the `/run/current-system/sw` bind mount
and mount only specific subdirectories we need, like the fonts.
Unfortunately, it is not clear what else is needed. For example,
in the past, Pipewire’s Jack module was loaded from `/run/current-system/sw/lib`
756e60344f
So, for now, let’s keep the and mount and move the binding of NixOS directories
to the end. Adding bindings starting at leaves and moving to root should be fine.
While at it, let’s also make the binding of `/run/current-system` conditional
since it will not be available outside of NixOS.
Fixes: https://github.com/NixOS/nixpkgs/issues/197085
USE_SYSTEMD was replaced by ENABLE_JOURNALD_LOG:
f1ff3cc0f5
-- Could NOT find Journald (missing: Journald_LIBRARY Journald_INCLUDE_DIR)
CMake Error at Source/cmake/OptionsGTK.cmake:486 (message):
libsystemd or libelogind are needed for ENABLE_JOURNALD_LOG
Call Stack (most recent call first):
Source/cmake/WebKitCommon.cmake:220 (include)
CMakeLists.txt:20 (include)
-- Configuring incomplete, errors occurred!
See also "/build/webkitgtk-2.36.0/build/CMakeFiles/CMakeOutput.log".
See also "/build/webkitgtk-2.36.0/build/CMakeFiles/CMakeError.log".
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.
The problem with enableGeoLocation was that it didn't compose well with
.overrideAttrs and setting geoclue2=null at the overlay level
because of the assert statement.
Thus, when combined with disabling libsecret, the resulting override code was:
avahi = null;
geoclue2 = { outPath = throw "geoclue is disabled"; };
webkitgtk = prev.lib.pipe prev.webkitgtk [
(x: x.override { enableGeoLocation = false; geoclue2 = prev.geoclue2; })
(x: x.overrideAttrs (old: { cmakeFlags = old.cmakeFlags ++ [ "-DUSE_LIBSECRET=OFF" ]; }))
(x: x.override { enableGeoLocation = false; geoclue2 = null; libsecret = null; })
];
It works, but is unnecessarily complex.
: detailed motviation
libsecret and geoclue2 are actually completely independent,
the real conflict is between assert and override/overrideAttrs which
don't work as expected; e.g. you can pass an updated parameter, but the
original parameter at callPackage "calltime" after recusion through overlays
gets used, so when globally setting "geoclue2=null;" in an overlay,
the assert is always hit without any way to work around that
If `/run/opengl-driver/lib` is in `LD_LIBRARY_PATH`, bwrap will try to
mount it into the already bind mounted `/run/opengl-driver`. To
prevent this, we instead specify the subpaths of `/run/opengl-driver`
we're interested in.
Also, use the correct path for i686 builds.