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)
Currently Chromium will generate its Web App shortcuts by pointing to
the current unwrapped executable of itself. This leads to all Web App
shortcuts failing to launch as it is not launched trough nixpkgs's
wrapper.
This fix will set the `CHROME_WRAPPER` environment variable to point
to a valid wrapper script, allowing chromium based browsers to generate
valid `.desktop` files.
NOTE: As these files are only set once by the browser inside of
`~/.local/share/applications` and not updated, this fix will only work
for generating new shortcuts, and only work as long as the relevant
binary is available in `$PATH` for that user.
INFO: While generic sounding, `CHROME_WRAPPER` is only invoked inside of
`web_app_shortcut_linux.cc`[^1], so it should only affect the generation
of web app shortcut files.
INFO: There is a similar patch for google-chrome itself in nixpkgs.[^2]
[^1]: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/shell_integration_linux.cc;l=405;drc=b8f43a4e55639b03f76eccc6f6b951f2d06b8833
[^2]: https://github.com/NixOS/nixpkgs/pull/155430/
We do already set `system_wayland_scanner_path` to
`"${wayland}/bin/wayland-scanner"` but apparently wayland-scanner wasn't
required (anymore?) as wayland-scanner is only in the `bin` output (I have a
few ideas what could've changed but didn't bother to check as it isn't worth
the time as long as it works now).
This fixes the following build error:
```
ninja: error: '../../../../../../../../nix/store/l3y9k2x7cqzcjj9s18z7la9xqsjq6r52-wayland-1.21.0/bin/wayland-scanner', needed by 'gen/components/exo/wayland/protocol/aura-shell-protocol.c', missing and no known rule to make it
```
Upstream switched use_system_libwayland to false [0] and
system_wayland_scanner_path will now only be declared if
use_system_wayland_scanner is set to true (it defaults to
use_system_libwayland) [1].
In Nixpkgs, we usually try to set use_system_* to true (i.e., we favor
system libraries over bundled/vendored ones) but in the case of Chromium
this can become difficult to maintain so we might eventually drop
`use_system_libwayland = true` again (IIRC this only caused one
incompatibility in the past though: b6b51374fc7; and f9d9864cb6 will
become relevant again when we build with the bundled libwayland).
[0]: b33bdfe265
[1]: 272220cefa