Commit Graph

2469 Commits

Author SHA1 Message Date
Franz Pletz
f9f7d7b58c
nixos/networkd: use upstream wait-online@ unit (#360319) 2024-12-03 21:40:30 +01:00
Philip Taron
898a5023f3
nixos/boot: merge to maintain commit signatures 2024-12-02 08:58:37 -08:00
Philip Taron
548eb2776d
nixos/boot: remove lib.mdDoc from boot.modprobeConfig.useUbuntuModuleBlacklist 2024-12-02 08:58:27 -08:00
Franz Pletz
357fff0f44
nixos/networkd: allow configuring RTTSec for CAKE qdisc (#285737) 2024-11-30 07:25:54 +01:00
Franz Pletz
0d48c50f4b
nixos/networkd: use upstream wait-online@ unit
Use the upstream unit for systemd-networkd-wait-online@.service and fix
the spelling.
2024-11-30 07:15:46 +01:00
Franz Pletz
18cf9ad14b
nixos/networkd: fix eval
Broken by #330662.
2024-11-30 07:08:18 +01:00
Franz Pletz
e383460f09
nixos/networkd: add dhcpServerConfig.PersistLeases option (#353189) 2024-11-30 06:46:51 +01:00
Franz Pletz
e5a4cc81ab
nixos/networkd: add some new options in systemd 256 (#330662) 2024-11-30 06:44:55 +01:00
Wolfgang Walther
d232880c20
various: remove left-over rtc_cmos rootModule
This is not needed anymore after
65a50ea453.
2024-11-26 22:02:46 +01:00
Sandro
8e82ef5df1
nixos/binfmt: add option addEmulatedSystemsToNixSandbox (#354533) 2024-11-26 16:35:42 +01:00
Sandro
4c79ccf34d
nixos/luksroot: make it harder to accidentially break cryptsetup (#355464) 2024-11-21 18:38:55 +01:00
Will Fancher
a599ce82dd
nixos/networkd: warn about naively replacing IPForward (#356955) 2024-11-18 20:10:52 -08:00
Will Fancher
768f628de7
nixos/systemd-stage-1: nixos-find-nixos-closure before initrd.target (#357135) 2024-11-18 19:33:21 -08:00
Will Fancher
af8279fe38 nixos/systemd-stage-1: nixos-find-nixos-closure before initrd.target
Without this, boot could proceed to the initrd cleanup step before the
closure was found, killing the service and breaking boot.
2024-11-18 21:14:51 -05:00
Maximilian Bosch
06f50f4adf
nixos/networkd: warn about naively replacing IPForward
See https://github.com/systemd/systemd/issues/33414.

The way this was phrased sounded like a dumb search/replace operation to
me. This resulted in random parts of my routing being broken (forward
from if X -> Y being fine, but the opposite direction being broken).

This change makes it explicit that it's a little more complicated and
you should really consult the docs before making that change.
2024-11-18 14:16:38 +01:00
Wolfgang Walther
8ca24a7a2b
nixos: remove boot.loader.raspberryPi
This has been announced for 24.11 in #241534, so let's follow through.
2024-11-17 12:33:57 +01:00
Sandro
b861831405
nixos/luksroot: make it harder to accidentially break cryptsetup 2024-11-12 16:53:46 +01:00
Will Fancher
6cfd95fc8c nixos/systemd-stage-1: Order nixos activation after initrd-switch-root.target
Now it's placed between initrd-switch-root.target and
initrd-switch-root.service, meaning it is truly the last thing to
happen before switch-root, as it should be.
2024-11-11 05:52:18 -05:00
Will Fancher
f065a81ab4 nixos/systemd-stage-1: Use chroot-realpath 2024-11-11 05:52:18 -05:00
Peder Bergebakken Sundt
bbb6e83f51 nixos/binfmt: add option addEmulatedSystemsToNixSandbox 2024-11-08 17:31:06 +01:00
Sandro
38ea21bd5d
Don't run hwclock if /etc/ is not writable (#353320) 2024-11-06 18:25:41 +01:00
Aleksana
81dacf0c91
nixos/systemd: fix enableStrictShellChecks description (#348513) 2024-11-05 23:03:19 +08:00
Samuel Tardieu
114ef67cbb Don't run hwclock if /etc/ is not writable 2024-11-03 10:42:21 +01:00
Matt Perlman
42ac7b2428 nixos/networkd: add dhcpServerConfig.PersistLeases option
PersistLeases was added to networkd version 256 (https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#PersistLeases=)
2024-11-02 13:55:14 -04:00
Christian Kögler
209e69f969
networkd: add missing option SendHostname and Hostname for dhcpV6Config (#348306) 2024-11-01 21:49:04 +01:00
Aleksana
2a3dc3d608
nixos/unl0kr: fix runaway example (#352516) 2024-10-31 16:06:36 +08:00
Sandro
61ee09bc5f
nixos/unl0kr: fix runaway example
We intend with 2 spaces
2024-10-31 02:52:33 +01:00
Yureka
0f216e2578 tree-wide: switch initrd generators back to gnu cpio
Originally, we switched to bsdtar from libarchive to solve a reproducibility issue related to hardlinks

As of gnu cpio 2.14 the --ignore-dirnlink option is introduced and now included in --reproducible, which solves this issue

By switching back, we are in turn solving an issue in libarchive >=3.7.5 erroring out with "Error reading archive -: (null)"

Change-Id: Ib6140d599b6547d8e941b0251ce996e303c41fa6
2024-10-31 01:21:59 +01:00
Frédéric Christ
8f4b41cfd4 nixos/systemd: Enable systemd-machine-id-commit.service
Prior to this contribution, every boot with a default configuration was
considered `ConditionFirstBoot=true` by systemd, since /etc/machine-id
was not commited to disk.

This also extends the systemd with a check for subsequent boots not
being considered first boots.
2024-10-25 14:03:15 +02:00
K900
c42028339a nixos/systemd-boot: fix substituteAll usage
Missed this one :(
2024-10-20 21:45:57 +03:00
Will Fancher
594ac9011f
nixos/systemd-initrd: add missing kmod-blacklist src (#348505) 2024-10-17 15:46:51 -04:00
Paul Meyer
71c64f8ecc initrd: drop effectless modification of kmod-blacklist
The perl snippet as been added years ago. I assume the intention was to
remove the `## file: iwlwifi.conf` section up to the next `## file:`,
but as there is no file following, the snippet currently does nothing.
We should be fine to remove it.

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-10-17 16:23:01 +02:00
r-vdp
24bf6e9cb8
nixos/etc-overlay: avoid rebuilding the initrd every time the etc contents change
Before this change, the hash of the etc metadata image was included in
the mount unit that's responsible for mounting this metadata image in the
initrd.
And because this metadata image changes with every change to the etc
contents, the initrd would be rebuild every time as well.
This can lead to a lot of rebuilds (especially when revision info is
included in /etc/os-release) and all these initrd archives use up a lot of
space on the ESP.

With this change, we instead include a symlink to the metadata image in the
top-level directory, in the same way as we already do for things like init and
prepare-root, and we deduce the store path from the init= kernel parameter,
in the same way as we already do to find the path to init and prepare-root.

Doing so avoids rebuilding the initrd all the time.
2024-10-16 17:42:58 +02:00
r-vdp
763dc50b08
nixos/systemd-initrd: pull the logic to find the nixos closure into a separate service 2024-10-16 17:42:50 +02:00
Will Fancher
a6e54f566a
nixos/networkd: support systemd-creds in WireGuard (#346964) 2024-10-15 14:31:27 -04:00
Sandro
eafd968bfd
nixos/systemd: fix enableStrictShellChecks description 2024-10-14 13:17:29 +02:00
Paul Meyer
2f6e0c8de3 nixos/systemd-initrd: add missing kmod-blacklist src
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-10-14 11:34:27 +02:00
Christian Kögler
5082384e7d networkd: add missing option SendHostname and Hostname for dhcpV6Config 2024-10-13 18:44:25 +02:00
Atemu
12ef18d2e3
nixos/systemd-boot: Simpler windows dual booting (#344327) 2024-10-11 20:25:08 +02:00
Felix Uhl
73011ba96f nixos/systemd-boot: add windows option for easy dual-booting
When installing NixOS on a machine with Windows, the "easiest" solution
to dual-boot is re-using the existing EFI System Partition (ESP), which
allows systemd-boot to detect Windows automatically.

However, if there are multiple ESPs, maybe even on multiple disks,
systemd-boot is unable to detect the other OSes, and you either have to
use Grub and os-prober, or do a tedious manual configuration as
described in the wiki:
https://wiki.nixos.org/w/index.php?title=Dual_Booting_NixOS_and_Windows&redirect=no#EFI_with_multiple_disks

This commit automates and documents this properly so only a single line
like

    boot.loader.systemd-boot.windows."10".efiDeviceHandle = "HD0c2";

is required.

In the future, we might want to try automatically detecting this
during installation, but finding the correct device handle while the
kernel is running is tricky.
2024-10-11 10:56:02 +02:00
Felix Uhl
f2e5b04c4e nixos/systemd-boot: add edk2-uefi-shell boot option
We already have a edk2-uefi-shell package in nixpkgs, but adding it to
systemd-boot was somewhat tedious. Now it's a single line of nix.
2024-10-11 10:53:42 +02:00
Felix Uhl
548206583d nixos/systemd-boot: autoformat 2024-10-11 10:53:38 +02:00
r-vdp
2b224f0e3c
nixos/systemd: allow using writeShellApplication for systemd unit scripts 2024-10-08 12:01:48 +02:00
Florian Klink
9c13bad7ca
nixos/tmpfiles: only setup nix-related tmpfiles if nix is enabled (#343784) 2024-10-07 09:11:46 +03:00
James Atkins
42f5ecde9d nixos/networkd: support systemd-creds in WireGuard
systemd 256 supports network.wireguard.* credentials (https://github.com/systemd/systemd/pull/30826).
Check whether PrivateKey / PresharedKey starts with an @, if so it is a credential.
2024-10-06 18:38:40 -05:00
Will Fancher
c00fc8bd1a
nixos/unl0kr: add settings to the unl0kr module (#339787) 2024-10-06 17:44:55 -04:00
Jared Baur
3d6e7d7b56
nixos/tmpfiles: only setup nix tmpfiles when nix is used
If nix is not installed on the end system, the tmpfiles settings related
to it do not need to be setup.
2024-10-05 09:01:55 -07:00
Will Fancher
3e90d5a2bc nixos/systemd-stage-1: Don't enable TPM2 on scripted stage 1 2024-10-04 19:50:46 -04:00
Sandro
d44717c448
nixos/binfmt: Add option to use static emulators when available (#334859) 2024-10-02 15:51:30 +02:00
Florian Klink
b66c0f2e99
nixos/systemd: let systemd setup /etc/machine-id (#327552) 2024-10-01 15:05:59 +03:00