Commit Graph

847 Commits

Author SHA1 Message Date
nikstur
a9bf6722ae systemd: drop 0004-Add-some-NixOS-specific-unit-directories.patch
This patch adds new functionality to systemd, which as per the new patch
policy is not allowed.

The main use-case this supports (imperatively installing systemd
services) is not used as far as I can tell and is not something we want
to support. Most services do not run anyways without further adjustments
on NixOS.
2026-04-10 00:38:51 +02:00
nikstur
207fe325e9 systemd: drop 0003-Fix-NixOS-containers.patch
This is possibile because of the preparations from b9f2fa1c7d
2026-04-10 00:38:51 +02:00
nikstur
b5611f96b6 systemd: drop 0001-Start-device-units-for-uninitialised-encrypted-devic.patch
This is possibile because of the preparations from b13891782f
2026-04-10 00:38:51 +02:00
nikstur
4346b3bf84 systemd: add patch policy 2026-04-10 00:38:51 +02:00
emilylange
2fb95a568c systemd: fix /etc/localtime symlink
This is essentially a revert of e8a805af10
in favor of a proper fix because unlike first assumed, this affects
not just systemd internally, but virtually any program that uses
icu::TimeZone to read the system's time zone.

And while we could patch icu, I believe this will take far too long and
we arguably don't know who else depends on the same assumption icu made.

All I know is every chromium-based browser[^0], including electron,
calls icu::TimeZone::detectHostTimeZone(), which returns the special
time zone Etc/Unknown instead of the configured one when using
timedated, either directly via timedatectl set-timezone or via D-Bus.

The reason for this is icu::TimeZone assumes[^1] every valid
/etc/localtime symlink includes /zoneinfo/ before the zoneinfo (olson)
timezone id.

This is a pretty decent guess and also applied to NixOS since ever, up
until we bumped systemd to v258 in 1c5d47dd78,
which included an upstream change that made the symlink relative.

The issue is, a relative /etc/localtime symlink in other distros results
in e.g. ../usr/share/zoneinfo/UTC, not zoneinfo/UTC. For NixOS, however,
we patch systemd to use /etc/zoneinfo instead of /usr/share/zoneinfo.

zoneinfo/UTC breaks the assumption icu::TimeZone makes, because
zoneinfo/ is not /zoneinfo/. We could try to trick it by needlessly
making the relative symlink ./zoneinfo/ instead, but this is both more
fragile and makes the patch significantly larger. And as stated above
already, we simply don't know who else makes similar assumptions.

So to fix this for good, we force the symlink to be absolute, just like
we had it prior to systemd v258.

Note that we could also simply unconditionally set

~~~nix
{
  systemd.services."systemd-timedated".environment.SYSTEMD_ETC_LOCALTIME = "/etc/localtime";
}
~~~

to make the symlink absolute. But I'd argue this would cause this
edge-case to slowly slide into obscurity, almost asking for it to
resurface in the future eventually.

[0]: https://source.chromium.org/chromium/chromium/src/+/refs/tags/146.0.7680.177:services/device/time_zone_monitor/time_zone_monitor.cc;l=57-59;bpv=0
[1]: https://github.com/unicode-org/icu/blob/release-78.3/icu4c/source/common/putil.cpp#L686-L695
2026-04-04 05:06:47 +02:00
r-vdp
13b2a08502 systemd: 260 -> 260.1 2026-03-25 11:39:23 +01:00
r-vdp
f2c276dae1 systemd: 259.5 -> 260
Changes:
- autovt@.service moved from a static meson-installed symlink to an
  [Install] Alias= on getty@.service upstream. We do not process
  [Install] sections, and logind still hardcodes spawning
  autovt@ttyN.service on VT switch, so recreate the alias.
- kmscon: suppress getty@.service instead of autovt@.service.
  Add static pull-in of kmsconvt@tty1 via getty.target since logind
  does not spawn autovt on tty1 by design.
- modprobe@.service: upstream switched ExecStart from /sbin/modprobe to
  a bare 'modprobe' relying on PATH. Update the substitution to match
  the new form, since DEFAULT_PATH on NixOS is systemd's own bindir
  which has no modprobe.
- Remove stale substituteInPlace patterns for paths removed upstream
  (/bin/echo in test-fileio.c, /bin/cat in cat.c, /usr/bin/getent in
  nspawn-setuid.c)
- Remove dead CFLAGS overrides for POLKIT_AGENT_BINARY_PATH (replaced
  by runtime find_executable) and SYSTEMD_CGROUP_AGENTS_PATH (cgroup-v1
  leftover, gone before v259). Use --replace-fail for the remaining
  config.h substitution so future removals fail loudly.
- Remove deprecated meson options (sysvinit-path, sysvrcnd-path, libidn)
- Handle new pull-oci.c tar references
- Drop upstreamed patch 0017-meson.build-do-not-create-systemdstatedir.patch
2026-03-25 11:39:22 +01:00
Will Fancher
666304f6f1 systemd: 259.3 -> 259.5 (#499420) 2026-03-14 01:49:18 +00:00
nixpkgs-ci[bot]
efa670fd22 Merge staging-next into staging 2026-03-14 00:22:22 +00:00
nixpkgs-ci[bot]
23ee7d594c Merge master into staging-next 2026-03-14 00:21:49 +00:00
r-vdp
e01ab04287 systemd: 259.3 -> 259.5 2026-03-13 20:01:18 +01:00
K900
9c01a67159 linux/common-config: EFI_VARS_PSTORE=y (#499077) 2026-03-12 06:50:38 +00:00
Florian Klink
b634b84a75 systemd: set kexec-path meson option (#498170) 2026-03-11 13:21:57 +00:00
Shiven Garia
ffe0111b60 systemd: set kexec-path meson option
Since systemd/systemd@c3f32b9, meson no longer probes $PATH to
locate kexec and instead hardcodes /usr/bin/kexec unless the
-Dkexec-path option is explicitly set.

kexec has probably only ever worked on NixOS because of the
fallback codepath in shutdown.c that reboots via RB_KEXEC when
the kexec binary isn't found.

Fixes #498149
2026-03-11 18:26:20 +05:30
Will Fancher
14ea6786cd linux/common-config: EFI_VARS_PSTORE=y
This enables the kernel to save crash logs much earlier, rather than
losing any log from before the efi_pstore module is loaded in stage 2.
2026-03-06 22:20:17 -05:00
r-vdp
1a80325b51 systemd: 259.2 -> 259.3 2026-03-06 23:38:28 +01:00
Alexander Bantyev
2839911e81 various: add security-review team as a maintainer
Adds the @NixOS/security-review team as a maintainer to multiple
packages deemed to be important security-wise.

For the motivation of the package list, see:
https://github.com/NixOS/nixpkgs/issues/494349#issuecomment-4005099033
2026-03-05 15:19:44 +01:00
r-vdp
76ae6f5387 systemd: 259 -> 259.2 2026-02-28 12:18:34 +01:00
nixpkgs-ci[bot]
e217c74eac Merge staging-next into staging 2026-02-06 18:16:24 +00:00
Markus Sütter
196b385317 various: add meta.identifier.cpeParts to a batch of packages 2026-02-02 09:22:55 +01:00
Arian van Putten
49213e9562 systemd: drop libcap dependency
woohoo! one less circular dep to worry about

from NEWS:
systemd no longer links against libcap at all. The simple system call
wrappers and other APIs it provides have been reimplemented directly
in systemd, which reduced the codebase and the dependency tree.
2026-01-17 21:56:07 +01:00
Grimmauld
d26521c9fa systemd: drop all musl patches 2026-01-17 21:55:42 +01:00
Arian van Putten
1ff4f6ef8a systemd: 258.3 -> 259
Had to revert https://github.com/NixOS/nixpkgs/pull/404902 as it gives
linker errors. And I don't think the systemd tests work on NixOS anyway.
2026-01-17 21:55:14 +01:00
Audrey Dutcher
e8a805af10 systemd: accept more symlink patterns for /etc/localtime 2025-12-30 18:08:57 -08:00
Will Fancher
1cc187b93a systemd: 258.2 -> 258.3 (#472183) 2025-12-28 12:23:31 +00:00
Arian van Putten
58f613d996 systemd: remove systemd-initrd-luks-unl0kr from passthru
IDK what unl0kr is. The tests have been broken on aarch64 since the
beginning and it's not part of systemd. The maintainer of unl0kr can be
responsible for maintaining the unl0kr tests
2025-12-25 13:04:31 +01:00
Acid Bong
0f0a9432ce systemd: update homepage
The Freedesktop page says "This page has been obsoleted and replaced. All
the new contents are on the new website: https://systemd.io/."
2025-12-25 07:00:10 +02:00
Arian van Putten
32119d46c0 systemd: 258.2 -> 258.3 2025-12-18 22:26:36 +01:00
matthewcroughan
34cd6f4869 nixos/systemd: make systemd-nspawn@.service optional 2025-12-07 00:19:44 +00:00
Grimmauld
ade259a29d systemd: disable utmp on musl
Fixes https://github.com/NixOS/nixpkgs/pull/461277#issuecomment-3556593423

Musl does not have utmp. Systemd implicitly disables utmp support,
but we need to document this disable in nix or else `nixos/modules/system/boot/systemd.nix`
will attempt to load a non-existant service resulting in errors.
2025-11-24 11:54:26 +01:00
Vladimír Čunát
7eb68367aa Merge branch 'master' into staging-next 2025-11-18 08:23:42 +01:00
Florian Klink
c417328854 systemd: enable more functionality on musl (#461277) 2025-11-17 18:20:40 +00:00
Alyssa Ross
43545a48f1 systemd: enable more functionality on musl
This was all originally disabled because it didn't build.  Now it
does, and we can probably expect it to going forward now that musl
support has been accepted upstream.
2025-11-13 15:52:20 +01:00
Florian Klink
7f58da583c systemd: 258.1 -> 258.2 (#459973) 2025-11-12 13:13:44 +00:00
Will Fancher
32220aae45 systemd: 258.1 -> 258.2 2025-11-11 23:53:23 -05:00
andre4ik3
21f767afc2 systemd: specify default-user-shell
This option is used to specify the default shell used for homed users,
among other things. By default it is set to `/bin/bash` which doesn't
exist on NixOS.

Setting this option makes `homectl create` work without having to
specify `--shell /run/current-system/sw/bin/bash`.
2025-11-05 07:21:10 +00:00
nikstur
44f90676ff systemd: various improvements (#451781) 2025-10-22 08:16:10 +00:00
Will Fancher
8461a645e0 systemd: 258 -> 258.1 2025-10-20 08:13:06 -04:00
nikstur
7081b4f992 systemd: re-enable hardening flag
The issue was fixed upstream in systemd according to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111523#c9
2025-10-19 01:58:28 +02:00
nikstur
7dfac72d67 systemd: stop pulling in kmod when kmod is disabled 2025-10-19 01:58:28 +02:00
nikstur
04d41ccd9a systemd: add withVConsole option 2025-10-19 01:58:28 +02:00
nikstur
251a798347 systemd: remove outdated comment 2025-10-19 01:58:28 +02:00
nikstur
863d1924d3 systemd: consistently use lib.getOutput 2025-10-19 01:58:28 +02:00
nikstur
9a7c5c5eaa systemd: use stripExclude instead of manual workaround 2025-10-19 01:58:28 +02:00
Yureka
4b1c77fd4e systemd: new musl patchset 2025-10-12 23:58:09 +02:00
nixpkgs-ci[bot]
e55c47d481 Merge master into staging-next 2025-10-11 12:05:40 +00:00
Sergei Trofimovich
75114216e2 systemd: drop reference to deleted systemd-timesyncd nixos test
Without the change the eval fails as:

    $ nix build --no-link -f. defaultPkgConfigPackages.libsystemd.tests
    error:
       … while evaluating the attribute 'systemd-timesyncd'

       … in the condition of the assert statement
         at pkgs/os-specific/linux/systemd/default.nix:1023:11:
         1022|           name: value:
         1023|           assert lib.assertMsg (lib.isDerivation value) "${name} is not a derivation";
             |           ^
         1024|           value

       … in the left operand of the OR (||) operator
         at /home/slyfox/dev/git/nixpkgs-master/lib/asserts.nix:50:31:
           49|   # TODO(Profpatsch): add tests that check stderr
           50|   assertMsg = pred: msg: pred || throw msg;
             |                               ^
           51|

       error: attribute 'systemd-timesyncd' missing
       at pkgs/os-specific/linux/systemd/default.nix:1010:13:
         1009|             systemd-sysusers-password-option-override-ordering
         1010|             systemd-timesyncd
             |             ^
         1011|             systemd-timesyncd-nscd-dnssec
2025-10-11 09:31:37 +01:00
nixpkgs-ci[bot]
e23d356469 Merge staging-next into staging 2025-10-05 00:18:23 +00:00
K900
f8d669f413 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-04 21:10:21 +03:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00