Commit graph

1458 commits

Author SHA1 Message Date
Silvan Mosberger b2d803ca57 nixos/treewide: Add last missing option types
Co-Authored-By: Janne Heß <janne@hess.ooo>
2022-02-28 22:50:06 +01:00
Dominique Martinet 0dadec45d8 logrotate/systemd: add 'minsize = 1M' to wtmp/btmp rotation
align with upstream logrotate which added the minsize rule at some point.
This avoids needlessly rotating the files too often as brought up in
https://github.com/NixOS/nixpkgs/pull/159187#issuecomment-1052426774
2022-02-27 07:20:26 +09:00
Janne Heß e5823f77b3
Merge pull request #159187 from martinetd/logrotate
logrotate service enhancements
2022-02-23 11:24:17 +01:00
Martin Weinelt c2147ab6a8
modprobe: install systemd's modprobe options
Shipped by systemd to combat kmod default options that interfere with
the netdev setup, when those drivers are initially loaded.
2022-02-22 17:22:57 +01:00
Christian Kögler 57fc08cfdb nixos: Switch to default systemd-nspawn behaviour 2022-02-19 09:52:37 +01:00
Vladimír Čunát 9d09daa0a9
Merge #157512: nixos/tmp: Fix format of /tmp mount options 2022-02-17 16:26:28 +01:00
Dominique Martinet 9917af7fe0 logrotate: move wtmp/btmp rules to systemd
wtmp and btmp are created by systemd, so the rules are more appropriate there.

They can be disabled explicitly with something like
  services.ogrotate.paths = {
    "/var/log/btmp".enable = false;
    "/var/log/wtmp".enable = false;
  };
if required.
2022-02-11 20:52:40 +09:00
Janne Heß b5b3ee4f78
nixos/systemd: Add reloadTriggers to services 2022-02-09 15:14:37 +01:00
Nikolay Amiantov 3dc6fab5c9 nixos/stage-1: add nixos modprobe options 2022-02-02 15:18:09 +03:00
Maciej Krüger 8bb7bec755
Merge pull request #141122 from Luflosi/add-apfs-nixos-module 2022-02-01 17:29:10 +01:00
Ramses 4cea257440 nixos/tmp: Fix format of /tmp mount options
The mount options need to be passed as a comma-separated list of options so that they
end up one a single Options line in the resulting mount unit.
The current code passed the options as a list, resulting in several Options lines in
the mount unit, all but the first of these were ignored by systemd however.
This behaviour is not clearly defined in the systemd man page.
2022-01-31 12:49:29 +01:00
Guillaume Girol 0d5c5e46da
Merge pull request #157053 from lheckemann/systemd-optional-cryptsetup
nixos/systemd: only use cryptsetup units if systemd was built with it
2022-01-30 16:04:17 +00:00
Linus Heckemann 4b27d4f9f8 nixos/systemd: only use cryptsetup units if systemd was built with it 2022-01-30 12:00:37 +01:00
Luflosi 26a695399a
nixos/apfs: init
Add the final missing pieces for full APFS support.
2022-01-27 15:18:45 +01:00
polykernel 4a9d9928dc nixos/nix-daemon: use structural settings
The `nix.*` options, apart from options for setting up the
daemon itself, currently provide a lot of setting mappings
for the Nix daemon configuration. The scope of the mapping yields
convience, but the line where an option is considered essential
is blurry. For instance, the `extra-sandbox-paths` mapping is
provided without its primary consumer, and the corresponding
`sandbox-paths` option is also not mapped.

The current system increases the maintenance burden as maintainers have to
closely follow upstream changes. In this case, there are two state versions
of Nix which have to be maintained collectively, with different options
avaliable.

This commit aims to following the standard outlined in RFC 42[1] to
implement a structural setting pattern. The Nix configuration is encoded
at its core as key-value pairs which maps nicely to attribute sets, making
it feasible to express in the Nix language itself. Some existing options are
kept such as `buildMachines` and `registry` which present a simplified interface
to managing the respective settings. The interface is exposed as `nix.settings`.

Legacy configurations are mapped to their corresponding options under `nix.settings`
for backwards compatibility.

Various options settings in other nixos modules and relevant tests have been
updated to use structural setting for consistency.

The generation and validation of the configration file has been modified to
use `writeTextFile` instead of `runCommand` for clarity. Note that validation
is now mandatory as strict checking of options has been pushed down to the
derivation level due to freeformType consuming unmatched options. Furthermore,
validation can not occur when cross-compiling due to current limitations.

A new option `publicHostKey` was added to the `buildMachines`
submodule corresponding to the base64 encoded public host key settings
exposed in the builder syntax. The build machine generation was subsequently
rewritten to use `concatStringsSep` for better performance by grouping
concatenations.

[1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2022-01-26 21:04:50 -05:00
github-actions[bot] bbbd0a92af
Merge master into staging-next 2022-01-25 00:02:13 +00:00
Luflosi 1c58cdbeed
nixos/modprobe: add boot.initrd.extraModprobeConfig option
This option behaves exactly like `boot.extraModprobeConfig`, except that it also includes the generated modprobe.d file in the initrd.
Many years ago, someone tried to include the normal modprobe.d/nixos.conf file generated by `boot.extraModprobeConfig` in the initrd: 0aa2c1dc46. This file contains a reference to a directory with firmware files inside. Including firmware in the initrd made it too big, so the commit was reverted again in 4a4c051a95.
The `boot.extraModprobeConfig` option not changing the initrd caused me much confusion because I tried to set the maximum cache size for ZFS and it didn't work.
Closes https://github.com/NixOS/nixpkgs/issues/25456.
2022-01-24 22:56:14 +01:00
github-actions[bot] 93a9821309
Merge master into staging-next 2022-01-23 18:01:11 +00:00
Janne Heß ce8c102a46
Merge pull request #155054 from jonringer/fix-systemd-boot
nixos/systemd-boot: fix error output
2022-01-23 16:23:13 +01:00
github-actions[bot] fd5336b13e
Merge master into staging-next 2022-01-21 18:01:25 +00:00
Janne Heß 45048dfd0a
Merge pull request #153095 from Madouura/dev/bcachefs-init
nixos/stage-1: colon-separated multi-device support
2022-01-21 16:35:10 +01:00
github-actions[bot] fc3ddb8979
Merge master into staging-next 2022-01-21 00:01:42 +00:00
datafoo 9bfb803dce nixos/networking: fix assertion on IPMasquerade 2022-01-20 13:43:12 +01:00
Jonathan Ringer 87502df43b
nixos/systemd-boot: fix error output 2022-01-14 15:42:19 -08:00
github-actions[bot] a6928c74cc
Merge master into staging-next 2022-01-13 12:01:29 +00:00
pennae 466cb747c8
Merge pull request #150408 from Enzime/systemd-boot-extra-entries
nixos/systemd-boot: Add `extraEntries` and `extraFiles` options
2022-01-13 07:15:05 +00:00
github-actions[bot] 7def368b6f
Merge master into staging-next 2022-01-12 18:01:16 +00:00
Alyssa Ross 5c8ddfd0b5 nixos/stage-1: update udev.log_level name in docs
I was confused why I couldn't find a mention of udev.log_priority in
systemd-udevd.service(8).  It turns out that it was renamed[1] to
udev.log_level.  The old name is still accepted, but it'll avoid
further confusion if we use the new name in our documentation.

[1]: 64a3494c3d
2022-01-12 14:04:14 +00:00
Madoura f363642de7
nixos/stage-1: colon-separated multi-device support 2022-01-09 18:06:03 -06:00
github-actions[bot] cf7efe1192
Merge staging-next into staging 2022-01-08 12:01:36 +00:00
Maciej Krüger 801d832872
Merge pull request #125451 from zhaofengli/qemu-riscv64-sd-image 2022-01-07 22:14:05 +01:00
Zhaofeng Li 16a907b00b generic-extlinux-compatible: Allow disabling generation of device tree directives 2022-01-06 17:23:10 -08:00
github-actions[bot] 1342506d40
Merge staging-next into staging 2022-01-07 00:04:19 +00:00
0x4A6F 29acc14f0d
Merge pull request #143060 from zhaofengli/binfmt-argv0
nixos/binfmt: Add QEMU wrapper to preserve argv[0]
2022-01-06 19:21:47 +01:00
Naïm Favier f2065d81ad stdenv/generic: introduce shellDryRun
Add `shellDryRun` to the generic stdenv and substitute it for uses of
`${stdenv.shell} -n`. The point of this layer of abstraction is to add
the flag `-O extglob`, which resolves #126344 in a more direct way.
2021-12-27 20:30:01 -05:00
Artturi 3239e947d1
Merge pull request #151156 from Artturin/fsckonbat 2021-12-27 04:18:40 +02:00
Michael Hoang 13903fef2d nixos/systemd-boot: Add option to add netboot.xyz 2021-12-23 11:44:29 +11:00
Michael Hoang f6b61981b1 nixos/systemd-boot: Support extra EFI entries 2021-12-23 11:44:29 +11:00
Florian Klink 60e571fa40
Merge pull request #150922 from ncfavier/systemd-tzdir
nixos/systemd: set TZDIR for PID 1
2021-12-22 11:52:27 +01:00
Artturin c44f95a855 nixos/stage1: run fsck on battery too
We are in 2021 almost 2022 not in 2004 when this may have been an issue!

https://alioth-lists.debian.net/pipermail/pkg-sysvinit-devel/2009-May/003196.html
https://www.nico.schottelius.org/blog/debian-ubuntu-fsck-skip-on-battery-bug/
d29daf3952
https://bugs.launchpad.net/ubuntu/+source/laptop-mode/+bug/11194
2021-12-18 06:06:10 +02:00
Graham Christensen 06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
Naïm Favier 901d4f13a3
nixos/systemd: set TZDIR for PID 1
Fixes #105049
2021-12-16 04:09:07 +01:00
Andreas Rammhold 6e69e537ff
Merge pull request #145183 from veehaitch/networkd-DHCPServerStaticLease
nixos/networkd: add `dhcpServerStaticLeaseConfig` option
2021-12-09 12:57:46 +01:00
pennae 2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00
ajs124 eee45bb295
Merge pull request #146815 from ElvishJerricco/systemd-utils-expressions
Move systemd-lib.nix and systemd-unit-options.nix into utils
2021-12-08 15:07:28 +00:00
Janne Heß e36ceb65e6
Merge pull request #129449 from ddz/copy-initrd-secrets-after-early-mount-script
nixos/stage1: copy initrd secrets into place after special mounts
2021-12-08 15:38:02 +01:00
Yuka ce54a4f658
nixos/networkd: add RoutingPolicyRule Type option (#146168) 2021-12-07 10:13:22 +01:00
pennae 2512455639 nixos/*: add trivial defaultText for options with simple defaults 2021-12-02 22:35:04 +01:00
Zhaofeng Li 9e5d0a9458 nixos/binfmt: Preserve argv[0] when using QEMU 2021-12-01 22:20:48 -08:00
Vincent Haupert ce81231420 nixos/networkd: add dhcpServerStaticLeaseConfig option
Add `systemd.network.networks.*.dhcpServerStaticLeaseConfig` to allow
for configuring static DHCP leases through the `[DHCPServerStaticLease]`
section. See systemd.network(5) of systemd 249 for details.

Also adds the NixOS test `systemd-networkd-dhcpserver-static-lease` to
test the assignment of static leases.
2021-11-30 09:58:33 +01:00