Commit Graph

2257 Commits

Author SHA1 Message Date
mutantmell
d51ebb6173 nixos/networkd: refactor
Reduces size of networkd module by moving unit file generation code into a util.
2023-07-01 17:17:51 -07:00
pennae
969b4d7ba9
Merge pull request #232454 from quentinmit/bridge-vlan
nixos/networkd: Fix typo in BridgeVLAN options
2023-07-01 00:19:37 +02:00
Lily Foster
35337085ea
Merge pull request #237820 from lilyinstarlight/fix/systemd-initrd-network-default-package
nixos/networkd: make overriding boot.initrd.systemd.package a little easier by using mkDefault
2023-06-27 15:58:57 -04:00
Naïm Favier
0179d9f7e6
nixos/top-level: change extraDependencies from package to pathInStore
Allows adding subdirectory flake inputs that aren't top-level store paths.
2023-06-27 11:48:08 +02:00
Felix Buehler
933a41a73f treewide: use optional instead of 'then []' 2023-06-25 09:11:40 -03:00
Ryan Lahfa
230a3705fc
Merge pull request #234223 from alyssais/stage-1-bind-file 2023-06-22 21:47:30 +02:00
Sandro Jäckel
900104fc52
nixos/grub: remove grub 1 from descriptions 2023-06-20 22:34:25 +02:00
r-vdp
c3fa4f9170
nixos/systemd: Make the fsck unit depend only on FS packages.
This means that this unit no longer need to be rebuilt when the system path is changed.
2023-06-18 12:46:13 +02:00
Lily Foster
be48010eb2
nixos/networkd: make overriding boot.initrd.systemd.package a little easier by using mkDefault 2023-06-14 16:09:25 -04:00
Wout Mertens
a97fe8990d
switch-to-configuration.pl: fix inverted dry-activate logic for swap 2023-06-14 12:11:45 +02:00
zi3m5f
67f5dcfd94 nixos/nspawn: fix spelling of systemd.nspawn MachineID option
This changes option systemd.nspawn.execConfig.MachineId to MachineID.
See man page systemd.nspawn(5)
2023-06-12 12:08:15 +02:00
Will Fancher
90d69b1634
Merge pull request #236388 from ElvishJerricco/sd-s1-networkd-stop-on-switch-root
systemd stage 1 networking: Stop systemd-networkd on switch-root
2023-06-10 00:35:56 -04:00
Will Fancher
5d6ea734a1 systemd stage 1 networking: Stop systemd-networkd on switch-root
This essentially backports
https://github.com/systemd/systemd/pull/27791. `systemd-networkd.service`
is sent the `SIGTERM` signal, but it is not required to be stopped
before `initrd-switch-root.target` is reached, despite the use of
`systemctl isolate initrd-switch-root.target`. This is because when
there is no ordering at all between two units, and a transaction stops
one and starts the other, the two operations can happen
simultaneously. This means the service could still be running when
`switch-root` actually occurs. Then, stage 2 systemd will see the
service still running and decide it doesn't need to add a start
operation for it to its initial transaction. Finally, the service
exits, but only after it's already too late. If, however, there is any
ordering at all between a stopping unit and a starting unit, then the
stop operation will be done first. This way, we ensure that the
service is properly exited before doing `switch-root`.

This is something to keep in mind going forward. There may be other
services that need this treatment. These `before` and `conflicts`
definitions are the correct way to ensure a unit is actually stopped
before you reach initrd-switch-root
2023-06-08 00:25:15 -04:00
Victor Engmark
8deaa732a8 refactor: Split mkdir -m … into mkdir + chmod
As recommended by ShellCheck
<https://www.shellcheck.net/wiki/SC2174>.
2023-06-08 15:55:40 +12:00
Will Fancher
b497502357 nixos: Use systemd-growfs for autoResize 2023-06-04 22:57:22 -04:00
Will Fancher
5176a4f113 nixos: Use systemd-makefs for autoFormat 2023-06-04 22:57:20 -04:00
Will Fancher
76d668fae7
Merge pull request #227628 from m-bdf/logind-handle-keys
nixos/logind: Add key handling options
2023-05-29 14:31:43 -04:00
Graham Christensen
479712af11
networkd: support specifying the ClientIdentifier for DHCPv4 options 2023-05-27 15:06:06 +02:00
Alyssa Ross
a92bc576b1
nixos/stage-1: support bind mounts of files
On my system, / is tmpfs, and /etc/machine-id is bind mounted from
/persist.
2023-05-26 13:26:48 +00:00
Will Fancher
fe43923a70
Merge pull request #229767 from mberndt123/mberndt123/stratis-rootfs
nixos/stratis: initrd support for stratis root volumes
2023-05-25 14:06:31 -04:00
Will Fancher
636e03bef3
Merge pull request #232533 from nikstur/systemd-repart-create-root
nixos/systemd-repart: enable creating root partition
2023-05-22 09:13:00 -04:00
figsoda
701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Bjørn Forsman
ef85c3fe51 nixos: use passAsFile to avoid "Argument list too long" error
This patch fixes "Argument list too long" build failure when passing a
list of store paths to system.extraDependencies that exceeds Linux'
MAX_ARG_STRLEN limit of 128 KiB. With the shortest possible derivation
names (one byte), the 128 KiB limit is equivalent to about 2850
derivations. With longer derivations names, the limit is hit earlier.
Fix this restriction.
2023-05-19 22:31:31 +02:00
Matthias Berndt
765349d345 minor refactoring 2023-05-19 10:22:45 -04:00
nikstur
ef80e11032 nixos/systemd-repart: enable creating root partition 2023-05-19 15:54:55 +02:00
Matthias Berndt
cb410a8c59 Merge remote-tracking branch 'upstream/master' into mberndt123/stratis-rootfs 2023-05-17 21:47:19 -04:00
Matthias Berndt
92814241a8 improve stratis initrd support
it is now possible to supply a stratis pool uuid
for every filesystem, and if that filesystem
is required for boot, the relevant pool will be
started in the initramfs.
2023-05-16 22:48:36 -04:00
Quentin Smith
ad7b199d5d
nixos/networkd: Fix typo in BridgeVLAN options 2023-05-16 19:33:34 -04:00
Robert Hensing
25f227fc67
Merge pull request #231316 from hercules-ci/nixos-system.checks
NixOS: add `system.checks`
2023-05-15 23:16:29 +02:00
Ryan Lahfa
1ee11b8a31
Merge pull request #231283 from nikstur/filesystems-erofs
nixos/filesystems: init erofs
2023-05-14 18:54:37 +02:00
Florian Klink
e9c6179ad0
Merge pull request #231504 from nikstur/systemd-repart-add-maintainer
nixos/systemd-repart: add myself as maintainer
2023-05-13 10:51:11 +03:00
nikstur
fa09e0a3c7 nixos/filesystems: init erofs
Enable using an erofs filesystem as one of the filesystems needed to
boot the system. This is useful for example in image based deployments
where the Nix store is mounted read only.
[erofs](https://docs.kernel.org/filesystems/erofs.html) offers multiple
benefits over older filesystems like squashfs. Skip fsck.erofs because
it is still experimental.
2023-05-12 19:55:32 +02:00
nikstur
1bd62f43eb nixos/systemd-repart: add myself as maintainer 2023-05-12 18:55:09 +02:00
Robert Hensing
5bdf63819b nixos/top-level.nix: Add system.checks
Note that this does not add to the `forbiddenDependenciesRegex`
code because that code check should be unaffected as it only checks
output dependencies, not build dependencies.
Build deps are added after that check, if those are enabled in the
first place.
2023-05-11 21:18:38 +02:00
ajs124
96fbdcedcd trustedGrub: remove 2023-05-10 22:17:56 +02:00
ajs124
1319323458 nixos/grub: turn definition of version option from an error into a warning
because a lot of configurations (generated by nixos-generate-config) contain it
2023-05-10 21:51:26 +02:00
ajs124
30bea8d82d nixos/*: remove boot.grub.version 2023-05-10 21:51:26 +02:00
Lin Yinfeng
1e05869917
nixos/networkd: fix typo of tokenBucketFilterConfig 2023-05-09 23:06:47 +08:00
nikstur
d85abd2764 nixos/systemd-repart: definition files in initrd
Store the definition files in the initrd instead of reading them from
the Nix store in /sysroot.

This way, the initrd has to be re-generated every time the definition
files change. When the path to the defintion files instead of the
definition files themselves are embedded in the initrd, however, the
initrd also has to be re-generated every time. In this regard, this
change does not improve the status quo.

However, now systemd-repart also works reliable when the Nix store is
mounted separately from the root partition.

This change also enables new use-cases like creating partitions
necessary to boot the system. However, by default, the root partition
cannot be created on first boot because the systemd-repart service
requires a /sysroot to be mounted. Otherwise, systemd-repart cannot
determine the device to operate on.
2023-05-09 00:11:21 +02:00
Matthias Berndt
8aa320b4c2 address code review issues 2023-05-08 23:18:55 +02:00
nikstur
5c2a7490cf nixos/systemd-repart: fix
Since v253, systemd-repart tries to create temporary directories in
/var/tmp. However, this directory doesn't exist in the initrd. This
commit adds an enviroment variable to re-use the existing /tmp directory
instead of /var/tmp.
2023-05-08 23:12:59 +02:00
Matthias Berndt
9f1bc0fa02 address review comments 2023-05-07 18:48:28 +02:00
Matthias Berndt
1632e73b19 nixos/stratis: enable booting from stratis volume 2023-05-07 18:48:28 +02:00
Bernardo Meurer
aa8eff129d
nixos/networkd: add TransmitQueues and TransmitQueueLength
These are relevant when using networkd to configure CAN networks

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
2023-05-06 21:55:09 -04:00
Ryan Lahfa
0b0c5fdf95
Merge pull request #230027 from jmbaur/fix-cross-nixos-system
nixos/bootspec: Fix cross for nixos-system systemBuilder
2023-05-05 22:05:44 +02:00
Ryan Lahfa
275a6e3d8d
Merge pull request #193469 from minijackson/mount-options-stage-1
nixos/stage-1: follow mount options
2023-05-05 17:05:48 +02:00
Jared Baur
67561dcc59
nixos/bootspec: Fix cross for nixos-system systemBuilder
When `nixpkgs.hostPlatform` != `nixpkgs.buildPlatform`, building the
top-level attribute fails since the bootspec portion of the system
builder tries to reference the host platform's `jq`. Change this to
reference the build platform's `jq`.
2023-05-04 20:09:16 -07:00
Rene Hollander
a70c7aba36 nixos/networkd: Fix typo in usage sectionBridgeVLAN
The `B` in bridge should be capitalized.

It currently leads to an evuluation error: 
```
error: attribute 'sectionbridgeVLAN' missing

       at /nix/store/7wmrwj0sgwg1iivxk43lpkqjhji57mq7-source/nixos/modules/system/boot/networkd.nix:2386:56:

         2385|       example = { VLAN = "10-20"; };
         2386|       type = types.addCheck (types.attrsOf unitOption) check.network.sectionbridgeVLAN;
             |                                                        ^
         2387|       description = lib.mdDoc ''
       Did you mean sectionBridgeVLAN?
```
2023-05-04 16:20:56 +02:00
Jörg Thalheim
be8e3128b9
Merge pull request #223418 from Mic92/grub
nixos/grub-install: don't rely on shell to run commands
2023-05-04 09:48:41 +01:00
Raito Bezarius
bc502d0a14 nixos/bootspec: adopt the merged RFC-0125
This removes the feature preview warning, enable by default bootspec,
adds a validation flag to prevent Go to go into build-time closure.

This will break all downstream users of bootspec as those changes are
not backward-compatible.
2023-04-28 18:26:11 -07:00