Commit Graph

2332 Commits

Author SHA1 Message Date
K900
24076029d2 Merge remote-tracking branch 'origin/master' into staging-next 2024-07-28 01:04:35 +03:00
Julien Malka
64edc7f00f nixos/systemd-boot: init boot counting
Update nixos/modules/system/boot/loader/systemd-boot/boot-counting.md

Co-authored-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
2024-07-26 20:04:37 +02:00
github-actions[bot]
2567b049bd
Merge master into staging-next 2024-07-25 18:00:59 +00:00
Anton Mosich
bc1c51d6d0
nixos/system: fix grammatical error in docs 2024-07-25 18:19:35 +02:00
Artturin
60e9cffe2c Merge branch 'master' into staging-next 2024-07-22 22:53:31 +03:00
nikstur
be0df72dfa
Merge pull request #328926 from nikstur/sysusers-only-for-sysusers
Sysusers only for sysusers
2024-07-22 20:55:58 +02:00
Marcus Ramberg
585a077fd2
Merge pull request #327665 from bolives-hax/add-qemu-s390x-binfmt
added s390x option type via magic attributes
2024-07-21 23:12:55 +02:00
bl0v3
e83fc89111 nixos/binfmt: added s390x option type via magic attributes 2024-07-21 20:17:16 +02:00
nikstur
2ca04530c9 nixos/systemd-sysusers: assert against password and hashedPassword
Regardless of mutable or immutable users, systemd-sysupdate never
updates existing user records and thus will for example never change
passwords for you.

It only support initial passwords and now actively asserts agains other
paswords.
2024-07-21 16:23:11 +02:00
nikstur
2710a49adb nixos/systemd-sysusers: stop creating users statically
On Linux we cannot feasbibly generate users statically because we need
to take care to not change or re-use UIDs over the lifetime of a machine
(i.e. over multiple generations). This means we need the context of the
running machine.

Thus, stop creating users statically and instead generate them at
runtime irrespective of mutableUsers.

When /etc is immutable, the password files (e.g. /etc/passwd etc.) are
created in a separate directory (/var/lib/nixos/etc). /etc will be
pre-populated with symlinks to this separate directory.

Immutable users are now implemented by bind-mounting the password files
read-only onto themselves and only briefly re-mounting them writable to
re-execute sysusers. The biggest limitation of this design is that you
now need to manually unmount this bind mount to change passwords because
sysusers cannot change passwords for you. This shouldn't be too much of
an issue because system users should only rarely need to change their
passwords.
2024-07-21 16:23:11 +02:00
nikstur
d43e323b4a nixos/systemd-sysusers: only create systemusers
systemd-sysusers cannot create normal users (i.e. with a UID > 1000).
Thus we stop trying an explitily only use systemd-sysusers when there
are no normal users on the system (e.g. appliances).
2024-07-21 16:22:01 +02:00
Will Fancher
6f959a9e96 nixos/make-initrd-ng: dlopen ELF notes 2024-07-21 06:31:42 -04:00
Will Fancher
e6c544270c nixos/make-initrd-ng: Pass contents as JSON 2024-07-21 06:31:42 -04:00
nikstur
d4a80b6d0c systemd: 255.6 -> 256.2 2024-07-21 06:31:37 -04:00
Sandro Jäckel
0e5342f48a
nixos/systemd-boot: give systemdBootBuilder a better name
Before it had twice a store hash which made nix store diff-closures
kinda ugly.
2024-07-16 19:53:57 +02:00
turtton
be20b91547 nixos/systemd-boot-builder: fix installed_match regex
Fix regular expression used to get bootloader versions from bootctl status.
This avoids problems that occur in minor environments like mine.

References:  #296563
2024-07-13 09:20:13 +02:00
Florian Klink
68767b54d3
Merge pull request #321935 from Ma27/nspawn-cgroupsv2
nixos/nspawn: cgroupsv2 by default
2024-07-12 18:06:08 +03:00
Julien Malka
6701c2c867
Merge pull request #323421 from Mic92/systemd-boot-builder 2024-07-07 19:36:09 +02:00
Mitchell Skaggs
5e1481ccc7
nixos/systemd-boot: fix invalid escape sequences
This was inadvertently introduced in https://github.com/NixOS/nixpkgs/pull/281639, but was not a loud warning until Python 3.12 made invalid escape sequences a `SyntaxWarning` instead of a `DeprecationWarning` in https://github.com/python/cpython/issues/98401.
2024-07-07 05:37:08 -05:00
Franz Pletz
aa8c9e6f2d
Merge pull request #317642 from melvyn2/systemd-networkd-network-options 2024-07-04 20:21:37 +02:00
Franz Pletz
a1ecdd6b1a
Merge pull request #276135 from nbdd0121/netdev 2024-07-04 18:35:15 +02:00
Robert Hensing
7b1af67486 nixos/journald: Link to journald manpage
This creates a link to https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html,
thanks to `doc/manpage-urls.json`.
2024-07-02 12:09:07 +02:00
r-vdp
d1e0f30cb2
Fix SSH in scripted initrd
Co-authored-by: Emily <vcs@emily.moe>
2024-07-01 15:35:55 +02:00
r-vdp
79d8116671
Fix ssh in initrd for systemd-initrd
Broken in https://github.com/NixOS/nixpkgs/pull/323753
2024-07-01 15:35:55 +02:00
Jörg Thalheim
ebfee308fc systemd-boot-builder: use type literals 2024-06-29 19:09:38 +02:00
Jörg Thalheim
6d0be2bec1 systemd-boot-builder: allow exceptions from python naming scheme 2024-06-29 19:09:28 +02:00
Jörg Thalheim
1ae4daa608 systemd-boot-builder: use safe run wrapper
we have a zoo of ways to call subprocesses.
Let's just replace this with one function that has reasonable defaults.
i.e. I catched instances where commands where run in a shell.
2024-06-29 19:09:06 +02:00
Jörg Thalheim
5cbf195292 systemd-boot-builder: use regex strings 2024-06-29 19:09:04 +02:00
Jörg Thalheim
f339bdf84c systemd-boot-builder: simplify conditions 2024-06-29 19:09:02 +02:00
Sandro
44b22d8d45
Merge pull request #318185 from tomfitzhenry/initrd-ssh-null-alg
nixos/initrd-ssh: set KexAlgorithms/Ciphers/MACs only if non-null
2024-06-25 23:21:33 +02:00
Michael Franzl
cae086d605
nixos/virtualisation: increase priority for libvirt NSS modules
When `services.resolved` is enabled, then `resolve [!UNAVAIL=return]`
is added to `system.nssDatabases.hosts` with priority 501,
which prevents lower-priority NSS modules from running
unless systemd-resolved is not available.

Quoting from `man nss-resolve`:

> To activate the NSS module, add "resolve [!UNAVAIL=return]" to the line
> starting with "hosts:" in /etc/nsswitch.conf. Specifically, it is
> recommended to place "resolve" early in /etc/nsswitch.conf's "hosts:"
> line. It should be before the "files" entry, since systemd-resolved
> supports /etc/hosts internally, but with caching. To the contrary, it
> should be after "mymachines", to give hostnames given to local VMs and
> containers precedence over names received over DNS. Finally, we
> recommend placing "dns" somewhere after "resolve", to fall back to
> nss-dns if systemd-resolved.service is not available.

Note that the man page (just) recommends "early" and means with this
"before the 'files' and 'dns' entries". It does not insist on being
first or excluding other modules.

For this reason, libvirt NSS modules should run before the `resolve`
module. They should come right next to `mymachines` because both are
conceptually very similar -- they resolve local VMs/containers.

Since the data source of the libvirt NSS modules are local
plain text files (see source code of the libvirt NSS module),
no performance impact is expected form this raise of priorities.

Other NSS modules in NixOS also explicitly set their priority, which is
why this change increases consistency.

Fixes #322022
2024-06-25 20:22:14 +02:00
Will Fancher
2893f56de0
Merge pull request #319359 from misuzu/clevis-zfs-fix
nixos/clevis: add support for parent encrypted zfs datasets
2024-06-24 14:47:55 -04:00
Maximilian Bosch
749aec8444
nixos/nspawn: cgroupsv2 by default
That way you also get features like cgroup accounting for systemd units
when using systemd-nspawn w/o classic nixos containers.
2024-06-23 11:48:58 +02:00
Philip Taron
faa579e444
nixos/systemd-boot: guard assertion messages against eval failures
These messages should be able to be printed in all cases. In particular, trying to coerce a `null` to a string is an error unless passed through `toString`.
2024-06-18 11:30:16 -07:00
Florian Klink
eabd9c36d9
Merge pull request #318604 from jmbaur/pref64-networkd
nixos/systemd-networkd: add PREF64 related options
2024-06-12 22:09:54 +03:00
misuzu
4df3c4c17b nixos/clevis: add support for parent encrypted zfs datasets 2024-06-12 21:21:50 +03:00
Ming-Chuan
9f488f27d7 nixos/initrd-ssh: Fix ignoreEmptyHostKeys description 2024-06-11 19:31:21 +10:00
Jared Baur
b867cc215f
nixos/systemd-networkd: add PREF64 related options 2024-06-09 20:41:32 -07:00
Tom Fitzhenry
54332f47ce nixos/initrd-ssh: set KexAlgorithms/Ciphers/MACs only if non-null
Prior to this commit, if services.openssh.settings.Macs is null, then
initrd-ssh.nix would fail to build.

Same for KexAlgorithms and Ciphers.

Noticed by @SuperSandro2000: https://github.com/NixOS/nixpkgs/pull/316934#issuecomment-2149659873
2024-06-08 15:14:26 +10:00
Pol Dellaiera
f2318b9d58
nixos/boot: use --replace-fail 2024-06-06 18:33:30 +02:00
melvyn
d4f459fa89
nixos/networkd: add new Network section options
Adds IPv4LLStartAddress, IPv4ReversePathFilter, IPv4ReversePathFilter, IPv4RouteLocalnet, and IPv4RouteLocalnet
2024-06-05 21:45:03 -07:00
Florian Klink
40066ba0d8
Merge pull request #316168 from dawidd6/systemd-user-generators
nixos/systemd: link user-generators
2024-06-05 09:59:29 +02:00
Dawid Dziurla
fbbc41f7da
nixos/systemd: simplify hooks function 2024-06-03 11:15:59 +02:00
Guillaume Girol
6ca2cfd75b
Merge pull request #313485 from tpwrules/copytoram-notif
nixos/stage-1-init: notify during copytoram
2024-06-01 21:06:33 +02:00
Dawid Dziurla
25ad0cdbfc
nixos/systemd: link user-generators 2024-05-30 19:52:22 +02:00
Dawid Dziurla
156757eaf7
nixos/systemd-user: add generators option 2024-05-30 19:51:42 +02:00
Franz Pletz
4e1b4397d9
Merge pull request #312472 from Ma27/networkd-option-rename
nixos/networkd: get rid of *Config attributes in lists
2024-05-30 04:06:01 +02:00
Jade Lovelace
e60c7e080d nixos/systemd-boot-builder: remove workaround for 10 year old Nix bug
This was originally introduced in 9245516b46,
which reveals it is a workaround for a Nix bug from 10 years ago that
was *fixed* 10 years ago.

References:
https://github.com/NixOS/nix/pull/425
https://github.com/NixOS/nixpkgs/issues/5494
2024-05-29 02:52:47 -07:00
Will Fancher
0415aec200
Merge pull request #297250 from NickCao/sysuser
nixos/systemd-sysusers: make uid/gid allocation stable
2024-05-26 20:17:06 -04:00
Thomas Watson
5aa9fc9273 nixos/stage-1-init: notify during copytoram
Demystifies a long pause at an unrelated message, particularly if the
source media is slow.
2024-05-22 18:43:18 -05:00