Commit graph

2074 commits

Author SHA1 Message Date
pennae 7e7d68a250 nixos/*: mark pre-existing markdown descriptions as mdDoc 2022-08-19 22:40:58 +02:00
pennae e4ed177f82 nixos/* eliminate inner whitespace in tags that was missed earlier
nix-doc-munge won't match tags that contain newlines anywhere. most of
these have already been removed, but a few obviously made it through.
2022-08-19 22:40:58 +02:00
peigongdsd 506cb62c4e modified: nixos/modules/system/boot/networkd.nix 2022-08-19 21:00:18 +08:00
peigongdsd 90de9ee689 nixos/modules/system/boot/networkd.nix: added Group= option in sectionLink of systemd.networkd config
see also: systemd.network(5)
2022-08-19 20:53:08 +08:00
Lily Foster 69d7943101 nixos/systemd-stage-1: unify initrd fstab generation logic with system fstab 2022-08-18 13:33:43 -04:00
Winter 771ef9f738 nixos/systemd-boot: use esp-path instead of path when calling bootctl
`path` has been aliased to `esp-path` for over 3 years (see fbf45d22da).
2022-08-18 01:08:07 -04:00
Jared Baur 4f58def5e6
Merge branch 'NixOS:master' into ipv6routeprefix 2022-08-17 15:08:31 -07:00
Weathercold 8fb63401af
nixos/switch-to-configuration: fix units starting with dash
Fix units starting with `-` being recognized as options.
2022-08-12 18:36:15 -04:00
pennae 50f9b3107a
Merge pull request #185474 from pennae/option-docs-md
nixos/*: more options md conversion
2022-08-12 23:23:26 +02:00
Sergei Trofimovich 925a9bb753
Merge pull request #185530 from trofi/restore-stage-1-strip
nixos/stage-1: srestore striping of bin/ and lib/
2022-08-11 08:50:45 +01:00
Jörg Thalheim 5a436f538f
Merge pull request #179619 from Informatic/plymouth-systemd-stage1-themes
nixos/plymouth: fix theme dependency resolution in systemd stage 1
2022-08-11 08:38:33 +01:00
Janne Heß 1120326a5b
Merge pull request #185067 from stigtsp/refactor/stc-no-net-debus
nixos/switch-to-configuration: replace Net::DBus with busctl
2022-08-09 20:28:49 +02:00
Robert Hensing 661c29c806
Merge pull request #181222 from hercules-ci/module-specialArgs
`_module.specialArgs` + unit test for nixos/documentation module
2022-08-08 11:53:10 +02:00
Sergei Trofimovich fb324910bf nixos/stage-1: srestore striping of bin/ and lib/
commit 0507725061 ("setup-hooks/strip.sh: run RANLIB on static
archives after stripping") added an extra argument to `stripDirs()`
helper.

I did not realize it's used outside the strip hook itself. Restore
stripping by passing $RANLIB as a new argument.
2022-08-07 11:05:29 +01:00
pennae 087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02:00
Bernardo Meurer 5b3a9a815d
Merge pull request #185089 from NickCao/bind
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts
2022-08-05 14:25:11 -07:00
pennae 423545fe48 nixos/*: normalize manpage references to single-line form
now nix-doc-munge will not introduce whitespace changes when it replaces
manpage references with the MD equivalent.

no change to the manpage, changes to the HTML manual are whitespace only.
2022-08-05 18:34:50 +02:00
pennae 93c57a9884
Merge pull request #185056 from pennae/option-docs-md
nixos/*: more option docs conversions
2022-08-05 17:36:49 +02:00
Christian Kögler 04d94dc8ff
Merge pull request #183897 from amarshall/networkd-fix-ipv6prefixes-example
nixos/networkd: Fix some invalid examples
2022-08-04 23:02:40 +02:00
Sandro 6c55138d9b
Merge pull request #184786 from danc86/fido2luks-discard 2022-08-04 15:08:58 +02:00
Dan Callaghan da26caad10
nixos/luksroot: allow discards with fido2luks 2022-08-04 19:32:14 +10:00
Nick Cao ce39bee9dd
nixos/stage-1-systemd: fix initrd-fstab generation for bind mounts 2022-08-04 10:26:37 +08:00
Will Fancher a454a706b5 shutdown: Protect system from make-initrd-ng 2022-08-03 22:18:47 -04:00
Stig Palmquist 4c2764c69c
nixos/switch-to-configuration: replace Net::DBus with busctl
Call dbus by using `$cur_systemd/busctl --json=...` and core modules
JSON::PP and IPC::Cmd to slim down dependencies for baseSystem.

perlPackages.NetDBus pulls in quite a few other dependencies, like
XML::Twig, LWP, and HTTP::Daemon. These are not really neccecary for
s-t-c, and some of them have caused issues particularly with cross
builds after updates to perlPackages.
2022-08-04 00:08:26 +02:00
pennae 61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae 3aebb4a2be nixos/*: normalize link format
make (almost) all links appear on only a single line, with no
unnecessary whitespace, using double quotes for attributes. this lets us
automatically convert them to markdown easily.

the few remaining links are extremely long link in a gnome module, we'll
come back to those at a later date.
2022-08-03 21:57:46 +02:00
pennae 9c8531c8a5 nixos/*: replace <replaceable>s with «thing»
we can't embed syntactic annotations of this kind in markdown code
blocks without yet another extension. replaceable is rare enough to make
this not much worth it, so we'll go with «thing» instead. the module
system already uses this format for its placeholder names in attrsOf
paths.
2022-08-03 21:08:58 +02:00
pennae 694d5b19d3 nixos/*: replace </para><para> with double linebreaks
our xslt already replaces double line breaks with a paragraph close and
reopen. not using explicit para tags lets nix-doc-munge convert more
descriptions losslessly.

only whitespace changes to generated documents, except for two
strongswan options gaining paragraph two breaks they arguably should've
had anyway.
2022-08-03 20:39:21 +02:00
K900 eabbad8af1
Merge pull request #185036 from K900/goblinization
make-initrd-ng: parse ELFs ourselves instead of shelling out to patchelf and friends
2022-08-03 19:57:55 +03:00
Janne Heß bc7ff29bdf
Merge pull request #184822 from snpschaaf/networkd-link-add-promiscious
add Promiscuous as valid value for linkConfig
2022-08-03 11:05:32 +02:00
Philippe Schaaf d5e7f6a613 add Promiscuous as valid value for linkConfig
configuring a network via
`systemd.network.networks.<name>.linkConfig`
does not allow to set the attr Promiscuous = "true";

This referes to:
https://www.freedesktop.org/software/systemd/man/systemd.network.html#Promiscuous=

Signed-off-by: Philippe Schaaf <philippe.schaaf@secunet.com>
2022-08-03 09:05:42 +02:00
Vladimír Čunát a0ebaa7431
Merge #183748: staging-next 2022-07-29 2022-08-03 09:04:16 +02:00
Florian Klink dfda3c3e04
Merge pull request #182577 from squalus/coredump
nixos: systemd-coredump: improve disabled state
2022-08-03 13:32:11 +07:00
Linus Heckemann 6fc909a1cc makeInitrdNG: make stripping fully optional
Now the tool will only strip binaries if a strip executable is passed
via the STRIP environment variable. This is exposed via the strip
option for makeInitrdNG and the NixOS option boot.initrd.systemd.strip.
2022-08-02 10:19:48 +03:00
github-actions[bot] 0f0010fda3
Merge master into staging-next 2022-08-02 06:02:34 +00:00
squalus 257db1dd4a nixos: systemd-coredump: improve disabled state
The systemd-coredump module required systemd to be built with
withCoredump=true, even if the module was disabled.

- allow systemd to be missing systemd-coredump if the module is disabled
- switch to mkDefault for the sysctl config to allow user overrides when
  the module is disabled
- add nixos tests for both the enabled and disabled cases
2022-08-01 09:52:56 -07:00
Jared Baur b1bb3bcad8 nixos/systemd.network: Add IPv6RoutePrefix options 2022-07-31 14:11:01 -07:00
pennae 2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Andrew Marshall 51adf865a3 nixos/networkd: Fix example for dhcpServerStaticLeaseOptions option
The example was not valid, and would raise an error.
2022-07-30 00:55:56 -04:00
Andrew Marshall a9fbd07f56 nixos/networkd: Fix example for ipv6Prefixes option
The example was not valid, and would raise an error.
2022-07-30 00:55:56 -04:00
github-actions[bot] c5298a170d
Merge staging-next into staging 2022-07-27 18:02:13 +00:00
pennae a16b25432e
Merge pull request #182685 from pennae/invariant-option-conversions
treewide: invariant option conversions to MD
2022-07-27 15:39:47 +02:00
github-actions[bot] 52e7c12c41
Merge staging-next into staging 2022-07-26 06:02:58 +00:00
Jared Baur 777e914c20 nixos/systemd.network: Add RequiredFamilyForOnline to linkConfig
While writing a configuration, I found a usage for this field and
noticed it was missing when building the configuration.
2022-07-26 04:11:33 +02:00
github-actions[bot] 4a6e124c33
Merge staging-next into staging 2022-07-24 12:02:06 +00:00
pennae ff56c775c8
Merge pull request #182098 from pennae/option-doc-md
convert some varlists in option docs to MD
2022-07-24 13:14:40 +02:00
pennae 860a0449ce nixos/system: invariant option docs MD conversions 2022-07-24 13:01:47 +02:00
github-actions[bot] b4832bac52
Merge staging-next into staging 2022-07-22 15:34:59 +00:00
Maximilian Bosch 779853b52b
Merge pull request #182413 from NetaliDev/pam-mount-fix-refactor
nixos/pam: refactor pam_mount unmounting fix
2022-07-22 14:05:44 +02:00
github-actions[bot] dec2508b80
Merge staging-next into staging 2022-07-22 12:02:21 +00:00
Florian Klink 7c119675a3
Merge pull request #179002 from klemensn/move-passwdEntry-type
move passwdEntry type
2022-07-22 14:16:57 +07:00
K900 c9183d3738 nixos/systemd: make sure all the device nodes are created in stage1
The ConditionFileNotEmpty override patch wasn't correct for stage1, which
does have the modules in /lib. So, remove the patch and set
the right path with overrides in the final system.

Also, make sure systemd-tmpfiles-setup-dev is pulled in to create
all the necessary symlinks.
2022-07-22 10:01:21 +03:00
Netali 93132dc09c
nixos/pam: refactor pam_mount unmounting fix 2022-07-22 04:17:14 +02:00
Robert Hensing ec3e1c6a3a nixos/documentation: Remove systemd/initrd dependency
Working towards a unit-testable documentation module.
2022-07-21 15:32:10 +02:00
pennae 7388711363 nixos/resolved: convert option docs to MD 2022-07-19 16:23:57 +02:00
Sandro Jäckel 4396fd615c
nixos/systemd-boot: remove default log message if nothing changes 2022-07-17 21:46:50 +02:00
Bernardo Meurer c6b0888a86
Merge pull request #180991 from aij/raspberrypi-bootloader-config.txt
raspberrypi-bootloader: Update doc URL for config.txt options
2022-07-10 14:09:43 -07:00
Sandro 366683965e
Merge pull request #166308 from ncfavier/wg-resolvconf
nixos/resolvconf: allow different implementations
2022-07-10 21:00:00 +02:00
Ivan Jager 34aa4fe7a9 raspberrypi-bootloader: Update doc URL for config.txt options
The old URL was redirecting to more generic Rasbperry Pi documentation.
2022-07-10 06:58:32 -05:00
Et7f3 6b820ecfab
nixos: systemd: add missing sliceToUnit (#179841)
Seem to be omitted in 022b4209a3 (diff-5ea4693beb4bdd8f7efcdd3204ceea67c86f59b3d1c28cde063ddf03e1d20fbfL29).
2022-07-02 18:56:53 +03:00
Piotr Dobrowolski 348b88545c nixos/plymouth: fix theme dependency resolution in systemd stage 1
Some plymouth themes use assets of others, like is the case with our
default bgrt depending on spinner. Missing assets would cause the
splashscreen to not render at all in stage 1.

Preliminary dependency resolution code seemed to be broken, and this
should fix it.

Only direct dependencies of selected theme are pulled in.
2022-06-29 21:38:34 +02:00
Klemens Nanni 30c36b4706 nixos/systemd-stage-1: use types.passwdEntry in emergencyAccess
`boot.initrd.systemd.emergencyAccess` expects passwd(5) formatted
strings, hence `singleLineStr` is too broad.

Use the same type as `users.users.*.hashedPassword` to ensure
consistency across all options where password hashes are used.

From `modules/config/users-groups.nix`:
```
       hashedPassword = mkOption {
         type = with types; nullOr (passwdEntry str);
       ...
       };
```
2022-06-25 16:34:49 +04:00
Naïm Favier 203696f098
nixos/resolvconf: add package
Expose the package that provides the system-wide `resolvconf` command
(either openresolv or systemd) to allow implementation-agnostic modules.
2022-06-21 22:58:43 +02:00
Sandro Jäckel 3df045e6d5
nixos/systemd: use cfg.package in systemPackages to avoid confusion 2022-06-09 22:44:28 +02:00
Matthias Treydte ff24f484af nixos/systemd-boot: fix systemd-boot-builder refusing to update
Handling of the string length condition in should_update
was broken, as evident with the log message

> leaving systemd-boot 246 in place (250.4 is not newer)

Discussion with @mweinelt came to the conclusion
that Python's "<" operator already does what we need,
so the should_update function can be dropped.

Fixes a30de3b849
2022-06-01 11:49:07 +02:00
Florian Klink f12a263b69
Merge pull request #172707 from klemensn/init-zfs-mount-options
nixos/stage-1: Fix library path in libraries, fix ZFS mount options
2022-05-30 10:51:17 +02:00
Matthias Treydte a30de3b849 nixos/systemd-boot: fix systemd-boot-builder dowgrade to fail
Since, 4ddc78818e systemd-boot-builder
is broken in two ways:

  * if no systemd-boot is currently installed *and* the NIXOS_INSTALL_BOOTLOADER
    env variable is not set, it will try to run "bootctl update", which will fail
  * if the currently installed systemd-boot version is newer than the version
    we're about to install, it will also try to run "bootctl update", which will fail

This patch changes the behaviour,

  * for the first case to still fail, but not even bother to try running
    "bootctl update" and instead erroring out with an exception
  * for the second case to leave the newer version in place, restoring
    the pre - 4ddc78818e behaviour

To do the proper version check a new "should_update" helper function was introduced,
mimicing the compare_product C function from bootctl. If the following systemd
issue gets resolved, we would have a nice way to get rid of this function:

> https://github.com/systemd/systemd/issues/23450

This change allows to again switch to a different NixOS configuration which contains
an older systemd-boot.

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
2022-05-28 13:18:21 +02:00
Klemens Nanni 9eb704b65a nixos/stage-1: Zap no longer needed LD_LIBRARY_PATH
The previous commit properly adjusts all library paths, thus no need to
forcefully adjust the path at runtime any longer.
2022-05-26 22:17:02 +02:00
Klemens Nanni d33e52b253 nixos/stage-1: Fix library path in libraries also
`extra-utils` composes the set of programs and libraries needed by

1. copying over all programs
2. copying over all libraries any program directly links against
3. set the runtime path for every program to the library directory

It seems that this approach misses the case where a library itself links
against another library.  That is to say, `extra-utils` assumes that
either only progams link against libraries or that every library linked
to by a library is already linked to by a program.

`mount.zfs` linking against `libcrypto`, in turn linking against `libdl`
shows how the current approach falls short:

```
$ objdump -p $(which mount.zfs) | grep NEEDED | grep -e libdl -e libcrypto
  NEEDED               libcrypto.so.1.1
$ ldd (which mount.zfs) | grep libdl
        libdl.so.2 => /nix/store/ybkkrhdwdj227kr20vk8qnzqnmj7a06x-glibc-2.34-115/lib/libdl.so.2 (0x00007f9967a9a000
```

Using `mount.zfs` directly in stage 1 init still works since
`LD_LIBRARY_PATH` overrides this (as intended).

util-linux's `mount` however executes `mount.zfs` with LD_LIBRARY_PATH
removed from its environment as can be seen with strace(1) in an
interactive stage 1 init shell (`boot.shell_on_fail` kernel parameter):

```
 # env -i LD_LIBRARY_PATH=$LD_LIBRARY_PATH $(which strace) -ff -e trace=/exec -v -qqq $(which mount) /mnt-root
execve("/nix/store/3gqbb3swgiy749fxd5a4k6kirkr2jr9n-extra-utils/bin/mount", ["/nix/store/3gqbb3swgiy749fxd5a4k"..., "/mnt-root"], ["LD_LIBRARY_PATH=/nix/store/3gqbb"...]) = 0
[pid  1026] execve("/sbin/mount.zfs", ["/sbin/mount.zfs", "<redacted>", "/mnt-root", "-o", "rw,zfsutil"], []) = 0
/sbin/mount.zfs: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1026, si_uid=0, si_status=127, si_utime=0, si_stime=0} ---
```

env(1) is used for clarity (hence subshells for absoloute paths).

While `mount` uses the right library path, `mount.zfs` is stripped of
it, so ld.so(8) fails resolve `libdl` (as required by `libcrypto`).

To fix this and not rely on `LD_LIBRARY_PATH` to be set, fix the library
path inside libraries as well.

This finally mounts all ZFS filesystems using `zfsutil` with correct and
intended mount options.
2022-05-26 22:17:02 +02:00
Klemens Nanni 4b045c7066 nixos/stage-1: Remove redundant symlink check
find(1)'s test `-type f` already excludes symbolic links, so `test -L`
will never return false for found files.
2022-05-26 22:17:02 +02:00
Klemens Nanni de77849ad6 nixos/stage-1: Account for hardcoded executable paths
At least pkgs/os-specific/linux/util-linux/default.nix uses
```
    "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin"
```

which does not cover stage 1 init's PATH as all executables are put
under /bin/.

Fix util-linux's `mount` usage by symlinking /sbin to it.
2022-05-26 22:17:02 +02:00
Klemens Nanni 9553106832 nixos/stage-1: Ensure correct ZFS mount options
Consider ZFS filesystems meant to be mounted with zfs.mount(8), e.g.
```
config.fileSystems."/media".options = [ "zfsutil" ];
config.fileSystems."/nix".options = [ "zfsutil" ];
```

`zfsutil` uses dataset properties as mount options such that zfsprops(7)
do not have to be duplicated in fstab(5) entries or manual mount(8)
invocations.

Given the example configuation above, /media is correctly mounted with
`setuid=off` translated into `nosuid`:

```
$ zfs get -Ho value setuid /media
off
$ findmnt -t zfs -no options /media
rw,nosuid,nodev,noexec,noatime,xattr,posixacl
```

/nix however was mounted with default mount(8) options:
```
$ zfs get -Ho value setuid /nix
off
$ findmnt -t zfs -no options /nix
rw,relatime,xattr,noacl
```

This holds true for all other ZFS properties/mount options, including
`exec/[no]exec`, `devices/[no]dev`, `atime/[no]atime`, etc.

/nix is mounted using BusyBox's `mount` during stage 1 init while /media
is mounted later using proper systemd and/or util-linux's `mount`.

Tracing stage 1 init showed that BusyBox never tried to execute
mount.zfs(8) as intended by `zfsutil`.

Replacing it with util-linux's `mount` and adding the mount helper
showed attempts to execute mount.zfs(8).

Ensure ZFS filesystems are mounted with correct options iff `zfsutil` is
used.
2022-05-26 22:16:53 +02:00
Martin Weinelt 6d8f8a7b46
Merge pull request #174090 from helsinki-systems/fix/plymouth
nixos/plymouth: Fix non-systemd initrd boot
2022-05-23 17:08:02 +02:00
Janne Heß 2cc4bf9427
nixos/plymouth: Fix non-systemd initrd boot 2022-05-23 11:17:21 +02:00
Klemens Nanni cbcc746f8f nixos/systemd: Package only built component units
Account for all `with*` options causing their respective unit files to
not be built, just like the current code `withCryptsetup` already does.

This fixes build errors like the following:
```
missing /nix/store/5fafsfms64fn3ywv274ky7arhm9yq2if-systemd-250.4/example/systemd/system/systemd-importd.service
error: builder for '/nix/store/67rdli5q5akzwmqgf8q0a1yp76jgr0px-system-units.drv' failed with exit code 1
```

Found by using a customised systemd package as follows:
```
systemd.package = pkgs.systemd-small;

nixpkgs.config.packageOverrides = pkgs: {

  "systemd-small" = pkgs.systemd.override {
    withImportd = false;
    withMachined = false;
    ...
  };

};
```
2022-05-16 16:52:25 +02:00
Alyssa Ross 85d792a928
nixos: don't put non-firmware in hardware.firmware
These two packages don't have a lib/firmware directory, so putting
them in hardware.firmware has no effect.  This will become a hard
error once firmware compression is implemented.

(In the case of Linux, the firmware was all moved to linux-firmware.)
2022-05-12 15:17:51 +00:00
Janne Heß e6fb1e63d1
Merge pull request #171650 from helsinki-systems/feat/config-systemd-package
treewide: pkgs.systemd -> config.systemd.package
2022-05-09 10:23:04 +02:00
Maximilian Bosch f0bb39d4b7
Merge pull request #167327 from lheckemann/networkd-usedhcp
nixos/networkd: reimplement useDHCP in a sensible way
2022-05-07 00:05:44 +02:00
Bernardo Meurer c4ad7519ef
Merge pull request #170136 from helsinki-systems/feat/systemd-stage-1-plymouth
nixos/plymouth: Add systemd stage 1 support
2022-05-05 14:49:26 -07:00
Sandro 836c52e625
Merge pull request #167208 from devplayer0/fix/missing-systemd-nspawn-options
nixos/systemd/nspawn: Add missing nspawn unit options
2022-05-05 22:58:59 +02:00
Janne Heß 57cd07f3a9
treewide: pkgs.systemd -> config.systemd.package
This ensures there is only one systemd package when e.g. testing the
next systemd version.
2022-05-05 20:00:31 +02:00
Rick van Schijndel ec4686ee14
Merge pull request #171247 from K900/systemd-boot-coreutils-mktemp
systemd-boot: use mktemp from coreutils in installer
2022-05-03 19:15:55 +02:00
Luflosi deed4a3d6c
nixos/stage-1: remove dead code
This special case for Btrfs was added in 51bc82960a. One year later beddd36c95 added code to skip the fsck entirely if the filesystem is Btrfs. This made the `if` statement unnecessary.
2022-05-03 16:15:51 +02:00
Janne Heß 2edce50847
Merge pull request #171134 from helsinki-systems/feat/make-initrd-ng-strip
makeInitrdNG: Strip more and remove output
2022-05-03 09:41:22 +02:00
K900 5a2f238b9a systemd-boot: use mktemp from coreutils in installer
People running nixos-install in non-NixOS environments
occasionally run into the mktemp builtin not being loaded
into bash (yes, even NixOS' bash). Rather than try and
figure out why exactly that is happening, just use a known
good mktemp from coreutils.
2022-05-02 15:44:55 +03:00
K900 5d02b86888 systemd-in-stage1: include firmware in initrd
duh.
2022-05-02 15:41:14 +03:00
Janne Heß bc53ac7753
nixos/systemd-shutdown: Remove unneeded binaries 2022-05-01 17:06:15 +02:00
Bernardo Meurer 78f6f77962
Merge pull request #169113 from ElvishJerricco/systemd-stage-1-installer-tests
nixos: Installer tests for systemd stage 1
2022-04-30 13:18:57 -07:00
Bernardo Meurer e1aa795705
Merge pull request #171024 from helsinki-systems/feat/systemd-stage-1-less-binaries
nixos/systemd-stage-1: Remove unnecessary binaries
2022-04-30 11:30:43 -07:00
Janne Heß 0411b51a00
nixos/systemd-stage-1: Remove unnecessary binaries
We can make the growfs and makefs binaries conditional because we know
if we'll need them. Also move the cryptsetup generator to the luksroot
so it's not included when not needed.

We drop some generators altogether: systemd-getty-generator because we
don't have getty anyway in stage 1, systemd-system-update-generator
because we don't use that logic in NixOS and
systemd-veritysetup-generator because stage 1 has no veritysetup support
(yet) and if it had, we still wouldn't want to include the generator
unconditionally.
2022-04-30 14:50:02 +02:00
Janne Heß fa2c9b41d4
nixos/systemd-stage-1: Add initrd secrets support 2022-04-30 11:41:27 +02:00
Maximilian Bosch 9c18662612
nixos/networkd: allow RouteMetric for IPv6AcceptRA
According to `systemd.network(5)` of systemd v249 this is a valid
option.

Fixes evaluation of the wildcard network definitions.
2022-04-30 00:30:04 +02:00
Will Fancher 2e96b64e02
Merge pull request #170123 from ElvishJerricco/systemd-shutdown-ramfs-fixup
Systemd shutdown ramfs fixup
2022-04-28 20:17:23 -04:00
Will Fancher 69d8047516 nixos: Fix up systemd shutdown ramfs 2022-04-28 14:12:14 -04:00
Bernardo Meurer 59aa6e4988
Merge pull request #170099 from helsinki-systems/feat/systemd-stage-1-no-random-seed
nixos/systemd-stage-1: Get rid of random-seed
2022-04-25 14:56:45 -07:00
Janne Heß 45494fab68
nixos/systemd-stage-1: Get rid of random-seed
This is not used at all since the unit has
ConditionPathExists=!/etc/initrd-release
2022-04-24 21:59:59 +01:00
Janne Heß acca3f4b81
nixos/plymouth: Add systemd stage 1 support 2022-04-24 21:47:49 +01:00
Janne Heß dc4b2812e4
nixos/stage-1-systemd: Also accept packages as store paths 2022-04-24 21:47:34 +01:00
Jack O'Sullivan 568cb2d6ab nixos/systemd/nspawn: Add missing nspawn unit options
A few options have been added to the `systemd.nspawn` unit type are
missing from `systemd.nspawn.*.*Config`. See systemd.nspawn(5).
2022-04-24 21:20:59 +01:00
Bernardo Meurer b23ec41f14
Merge pull request #168554 from helsinki-systems/feat/systemd-stage-1-luks
nixos/systemd-stage-1: Add basic LUKS support
2022-04-22 12:37:25 -07:00
Artturi 98ff3e401c
Merge pull request #165892 from tpwrules/fix-initrd-dirlinks
make-initrd: fix reproducibility problems
2022-04-21 20:51:35 +03:00
Janne Heß 1bea49d3bf
nixos/stage-1-systemd: Add LUKS w/ password support 2022-04-18 11:42:45 +01:00
Florian Klink 52e346d6dd
Merge pull request #168774 from helsinki-systems/feat/systemd-shutdown
nixos/systemd: Properly shut down the system
2022-04-18 09:52:07 +02:00
Will Fancher 9e8b463cce nixos: Handle panic_on_fail in systemd stage 1 2022-04-17 18:31:35 -04:00
Sandro b4e7303ddf
nixos/specialisation: fix curly brackets 2022-04-17 05:48:33 +02:00
Janne Heß 30a00c29c4
nixos/systemd: Properly shut down the system 2022-04-16 21:17:36 +01:00
Janne Heß 031b95e587
Merge pull request #168814 from helsinki-systems/feat/systemd-stage-1-pass-vars
nixos/systemd-stage-1: Pass more vars to the builder
2022-04-16 22:02:26 +02:00
Janne Heß b9bf28fd70
nixos/stage-1-init: Pass all parameters to the builder
This is for compatiblity with the old builder to get compat with uboot
support and to prepend microcode updates to the initrd
2022-04-16 20:36:18 +01:00
Janne Heß 01bc138a8e
nixos/stage-1-init: Merge mdraid module into swraid 2022-04-15 19:57:16 +01:00
Thomas Watson 7fd6cea253 make-initrd: fix reproducibility problems
cpio includes the number of directory hard links in archives it creates.
Some filesystems, like btrfs, do not count directory hard links the same
way as more common filesystems like ext4 or tmpfs, so archives built
when /tmp is on such a filesystem do not reproduce. This patch replaces
cpio with bsdtar, which does not have this issue. The specific
invocation is from this page:
https://reproducible-builds.org/docs/archives/
2022-04-14 19:06:30 -05:00
Lassulus 15b5c29a41
Merge pull request #168600 from helsinki-systems/feat/systemd-stage-1-keymap
nixos/stage-1-systemd: Add keymap support
2022-04-14 21:50:52 +01:00
Janne Heß 289f38a65b
Merge pull request #168301 from helsinki-systems/feat/systemd-stage-1-mdadm
nixos/stage-1-systemd: Add mdraid support (+ test)
2022-04-14 17:56:36 +02:00
Janne Heß dda7e9e3ee
nixos/stage-1-systemd: Add mdraid support (+ test) 2022-04-14 11:39:57 +01:00
Janne Heß 0581d31bf9
Merge pull request #167393 from iblech/patch-docs-cc
nixos-rebuild, switch-to-configuration: document and protect against cross compilation subtlety
2022-04-14 12:30:39 +02:00
Janne Heß 6d6c1c341c
nixos/stage-1-systemd: Add keymap support
Makes my life a lot easier with my non-american keyboard layout
2022-04-14 10:25:04 +01:00
Janne Heß aeb75b3b69
nixos/stage-1-systemd: Implement hibernation + test 2022-04-13 23:02:13 +01:00
Janne Heß ffb320378b
nixos/stage-1-systemd: Fix booting grub tests 2022-04-13 23:02:10 +01:00
Lassulus 65cc198539
Merge pull request #167349 from helsinki-systems/feat/udev-systemd-stage-1
nixos/udev: Add systemd stage 1 support
2022-04-12 21:02:52 +01:00
Lassulus c0139fe5c3
Merge pull request #167168 from helsinki-systems/feat/systemd-stage-1-proper-handover
nixos/stage-1-systemd: Handover between the systemds directly
2022-04-11 22:26:11 +01:00
Janne Heß 3df2691e6b
nixos/stage-1-systemd: Handover between the systemds directly 2022-04-11 20:04:33 +01:00
Janne Heß fb44ecd129
nixos/udev: Add systemd stage 1 support 2022-04-11 19:43:26 +01:00
Erik Arvstedt 63528cb1a6
nixos/systemd: remove duplicate definition of systemd.user.timers
It's already defined in `systemd/user.nix`.
This is a leftover from commit b6d50528dd
where all `systemd.user` settings were moved to `systemd/user.nix`.
2022-04-11 13:01:40 +02:00
Janne Heß adab6ce552
nixos/systemd-stage-1: Minor fixups
- Fix the name of the env
- Add the correct kmod to the initrd
- Add `less` to make journalctl usable
- Fix SYSTEMD_SULOGIN_FORCe for rescue.target
- Add some missing binaries
2022-04-11 11:13:01 +01:00
Luke Granger-Brown 4ea239aa70
Merge pull request #163958 from lukegb/networkd-main
nixos/networkd: configure /etc/systemd/networkd.conf
2022-04-11 02:01:19 +01:00
Luke Granger-Brown f47caf769b nixos/networkd: configure /etc/systemd/networkd.conf
The networkd.conf file controls a variety of interesting settings
which don't seem to be configurable at the moment, including
adding names to route tables (for networkd only, although this commit
also exports them into iproute2 for convenience's sake), and
the speed metering functionality built into networkd.

Importantly, however, this also allows disabling the systemd
functionality where it likes to delete all the routes and routing rules
that haven't been configured through networkd whenever something causes
it to perform a reconfiguration.
2022-04-11 00:28:33 +00:00
Thiago Kenji Okada d1f7cc85b5
Merge pull request #161272 from dmadisetti/master
nixos/grub: module options to modify entry classes
2022-04-06 23:14:15 +01:00
Ingo Blechschmidt c3428419e0 nixos/switch-to-configuration: Provider better error message in cross-compiling situations 2022-04-05 16:52:09 +02:00
github-actions[bot] 27a4e52731
Merge master into staging-next 2022-04-05 12:05:41 +00:00
Lassulus b69bd66518
Merge pull request #167242 from helsinki-systems/feat/systemd-stage-1-variable-bin
nixos/systemd-stage-1: Softcode bin tools...
2022-04-05 09:39:19 +01:00
Janne Heß acf089edef
nixos/systemd-stage-1: Softcode bin tools...
...and other cleanups and fixes
2022-04-04 22:56:31 +01:00
github-actions[bot] 5844b1c2fa
Merge master into staging-next 2022-04-04 18:01:27 +00:00
Lassulus 5083d22ec5
Merge pull request #167167 from helsinki-systems/feat/systemd-stage-1-less-systemd-files
nixos/stage-1-systemd: Limit files to the bare necessities
2022-04-04 18:25:55 +01:00
Janne Heß 41d3ca0677
nixos/systemd-stage-1: Use an own systemd package
We need more features than systemdMinimal but less than systemd so we
need some own packages :/
2022-04-04 18:12:45 +01:00
Martin Weinelt c6476294e1 Merge remote-tracking branch 'origin/master' into staging-next 2022-04-04 18:40:34 +02:00
Janne Heß 75ece4eb82
nixos/stage-1-systemd: Limit files to the bare necessities 2022-04-04 12:54:18 +01:00
Janne Heß 4b9efea255
nixos/stage-1-systemd: Implement job scripts 2022-04-04 11:44:31 +01:00
Martin Weinelt bb7e4b378e Merge remote-tracking branch 'origin/master' into staging-next 2022-04-04 00:46:44 +02:00
Janne Heß 56b4653904
nixos/stage-2-init: Re-add creation of /etc 2022-04-03 19:03:16 +01:00
github-actions[bot] c46200d454
Merge master into staging-next 2022-04-03 18:01:07 +00:00
Janne Heß 371504ac8e
Merge pull request #167019 from NixOS/fix/systemd-env
nixos/stage-2-init: Don't clear environment
2022-04-03 16:36:26 +02:00
Janne Heß 7cdc4dd5d1
Merge pull request #164943 from ElvishJerricco/systemd-initrd-reuse-systemd-module
initrd: Opt-in bare bones systemd-based initrd
2022-04-03 15:53:02 +02:00
Lassulus e65b825672
Merge pull request #165684 from helsinki-systems/clean/stage-2-init
nixos/stage-2-init: Clean up legacy commands
2022-04-03 14:12:52 +02:00
Janne Heß ea473fac72
nixos/stage-2-init: Don't clear environment
This breaks NixOS Containers because systemd needs some env variables
from the outside.
2022-04-03 11:12:00 +01:00
github-actions[bot] fc17fe6417
Merge master into staging-next 2022-04-02 18:01:07 +00:00
7c6f434c 8188f10752
Merge pull request #166430 from alyssais/openssl-static-retry
treewide: use lib.getLib for OpenSSL libraries
2022-04-02 12:59:55 +00:00
github-actions[bot] 8b4f11bb87
Merge master into staging-next 2022-04-02 00:02:09 +00:00
Florian Klink 401cb86da1
Merge pull request #166142 from ncfavier/wait-online
nixos/networkd: add `wait-online` options
2022-04-01 22:54:28 +02:00
Janne Heß 7ebb4ebe40
nixos/systemd-stage-1: Append (Initrd) to /etc/initrd-release
This is more in line with what dracut does (it appends "Initramfs") and
makes it clear where the boot is currently at when it hangs.
2022-04-01 13:54:09 +02:00
Janne Heß 5653209ed9
nixos/systemd-initrd: Redo object specifications
As requested by @roberth, we now have an option similar to
environment.etc. There's also extra store paths to copy and a way to
suppress store paths to make customizations possible.

We also link mount and umount to /bin to make recovery easier when
something fails
2022-04-01 13:26:06 +02:00
Janne Heß c465c8d719
nixos/systemd-initrd: Make emergency access more flexible 2022-04-01 11:58:31 +02:00
Janne Heß b7c62b8238
nixos/systemd-initrd: Remove unit options that don't work 2022-04-01 11:58:30 +02:00
github-actions[bot] 5e1c018e60
Merge master into staging-next 2022-04-01 06:01:23 +00:00
Dominique Martinet e92c05349c nixos/logrotate: convert to freeform
using freeform is the new standard way of using modules and should replace
extraConfig.
In particular, this will allow us to place a condition on mails
2022-04-01 07:09:26 +09:00
github-actions[bot] be4f006d3c
Merge master into staging-next 2022-03-31 18:01:13 +00:00
Silvan Mosberger 2da8e63ce8
Merge pull request #111595 from Luflosi/add-cherry-usb-kb-kernel-module
nixos/availableKernelModules: add cherry hid
2022-03-31 17:14:29 +02:00
madisetti 9dddd48c4c nixos/grub: added configuration option for entry options 2022-03-31 06:39:16 -04:00
Martin Weinelt d0bfb3ccbb Merge remote-tracking branch 'origin/master' into staging-next 2022-03-31 03:49:37 +02:00
ajs124 35619ce1e5
Merge pull request #165453 from helsinki-systems/feat/systemd-manager-environment
nixos/systemd: Switch to ManagerEnvironment=
2022-03-31 01:35:09 +02:00
Janne Heß a3e0698bf6
nixos/systemd: Switch to ManagerEnvironment=
This accomplishes multiple things:
- Allows us to start systemd without stage-2-init.sh. This was not
  possible before because the environment would have been wrong
- `systemctl daemon-reexec` also changes the environment, giving us
  newer tools for the fs packages
- Starts systemd in a fully clean environment, making everything more
  consistent and pure
2022-03-30 20:24:27 +02:00
Alyssa Ross fd78240ac8
treewide: use lib.getLib for OpenSSL libraries
At some point, I'd like to make another attempt at
71f1f4884b ("openssl: stop static binaries referencing libs"), which
was reverted in 195c7da07d.  One problem with my previous attempt is
that I moved OpenSSL's libraries to a lib output, but many dependent
packages were hardcoding the out output as the location of the
libraries.  This patch fixes every such case I could find in the tree.
It won't have any effect immediately, but will mean these packages
will automatically use an OpenSSL lib output if it is reintroduced in
future.

This patch should cause very few rebuilds, because it shouldn't make
any change at all to most packages I'm touching.  The few rebuilds
that are introduced come from when I've changed a package builder not
to use variable names like openssl.out in scripts / substitution
patterns, which would be confusing since they don't hardcode the
output any more.

I started by making the following global replacements:

    ${pkgs.openssl.out}/lib -> ${lib.getLib pkgs.openssl}/lib
    ${openssl.out}/lib -> ${lib.getLib openssl}/lib

Then I removed the ".out" suffix when part of the argument to
lib.makeLibraryPath, since that function uses lib.getLib internally.

Then I fixed up cases where openssl was part of the -L flag to the
compiler/linker, since that unambigously is referring to libraries.

Then I manually investigated and fixed the following packages:

 - pycurl
 - citrix-workspace
 - ppp
 - wraith
 - unbound
 - gambit
 - acl2

I'm reasonably confindent in my fixes for all of them.

For acl2, since the openssl library paths are manually provided above
anyway, I don't think openssl is required separately as a build input
at all.  Removing it doesn't make a difference to the output size, the
file list, or the closure.

I've tested evaluation with the OfBorg meta checks, to protect against
introducing evaluation failures.
2022-03-30 15:10:00 +00:00
Naïm Favier d113e4e06e
nixos/networkd: add wait-online options 2022-03-29 10:14:26 +02:00
github-actions[bot] df0f3ba49a
Merge master into staging-next 2022-03-29 06:01:16 +00:00
Janne Heß 452102db8f
nixos/stage-2-init: Clean up legacy commands
We can perform most of the mkdir/ln/rm using systemd-tmpfiles
instead which cleans up the script.

/bin and /home are created by their activation script snippets

usbfs is deprecated and unused.

hwclock seems to be automatically executed by systemd on startup.

The mkswap to prevent hibernation cycles seems to be executed by systemd
as well since the provided regression tests succeeds.
2022-03-27 13:51:02 +02:00
Janne Heß 158a2972eb
nixos/filesystems: Move options into the fs module
This was probably forgotten during a refactoring. The module is where
the values of the options are actually used.
2022-03-27 13:23:44 +02:00
Florian Klink e3083decc4 systemd-initrd, systemd-lib: drop initrdServiceToUnit
We can just use serviceToUnit here.
2022-03-24 18:57:16 +01:00
Florian Klink 74bae06748 systemd-initrd: use pkgs.fakeNss, document why we need libnss_files.so 2022-03-24 18:51:32 +01:00
Will Fancher 5bfe213315 Clarify suppressed units description 2022-03-22 21:28:51 -04:00
Will Fancher 213de9b108 systemd-initrd: autoFormat and autoResize in initrd 2022-03-22 21:28:51 -04:00
Will Fancher 1abf154179 systemd-initrd: Add PATH to everything 2022-03-22 21:28:50 -04:00
Will Fancher 2d4ebf1259 initrd: Optional systemd-based initrd 2022-03-22 21:28:43 -04:00
Will Fancher 25113740a5 nixos: systemd-lib: Make generateUnits general with default args 2022-03-22 07:02:23 -04:00
Will Fancher 52c98fc3e9 nixos: systemd: Split unit types into separate module 2022-03-21 10:25:27 -04:00
github-actions[bot] de642acb2e
Merge staging-next into staging 2022-03-21 12:10:50 +00:00
Florian Klink 9427a17ccb
Merge pull request #164016 from bobvanderlinden/pr-refactor-systemd-module
nixos: systemd: split module up into multiple files
2022-03-21 13:03:55 +01:00
Bob van der Linden 397b8257a0
nixos: systemd-user: fix additionalUpstreamUserUnits description
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
2022-03-21 12:30:37 +01:00
Bob van der Linden 92af44e04d
nixos: systemd: remove unhelpful comments in additionalUpstreamSystemUnits
Co-authored-by: Janne Heß <janne@hess.ooo>
2022-03-20 16:14:13 +01:00
Janne Heß 85874efcb0
nixos/switch-to-configuration: Make perlcritic happy 2022-03-20 13:04:23 +01:00
Janne Heß 9c494b5773
nixos/switch-to-configuration: Snake-case all variables
Also add a lot of comments and reorder some assignments
2022-03-20 13:03:39 +01:00
Janne Heß 67f84b4b87
nixos/switch-to-configuration: Snake-case all subroutines and add comments 2022-03-20 13:03:19 +01:00
Janne Heß 23ea9965bb
nixos/switch-to-configuration: Enforce consistent quoting 2022-03-20 13:01:11 +01:00
Janne Heß bdcd558812
nixos/switch-to-configuration: Get rid of all postfixes and unlesses 2022-03-20 13:01:11 +01:00
Bob van der Linden 6514bb4620
nixos: systemd-user: make additionalUpstreamUserUnits internal 2022-03-19 12:06:56 +01:00
Bob van der Linden 66759cea7d
nixos: systemd-user: expand on additionalUpstreamUserUnits description 2022-03-19 12:06:43 +01:00
Bob van der Linden 753b911708
nixos: systemd-tmpfiles: use cfg shorthand 2022-03-17 23:16:38 +01:00
Bob van der Linden 38d043de9c
nixos: systemd: split off systemd-tmpfiles into separate module 2022-03-17 23:16:37 +01:00
Bob van der Linden 0e665d1815
nixos: systemd-user: allow additional upstream user units
Currently it is only possible to add upstream _system_ units. The option
systemd.additionalUpstreamSystemUnits can be used for this.

However, this was not yet possible for systemd.user. In a similar
fashion this was added to systemd-user.nix.

This is intended to have other modules add upstream units.
2022-03-17 23:16:37 +01:00
Bob van der Linden b6d50528dd
nixos: systemd-user: use cfg shorthand 2022-03-17 23:16:37 +01:00
Bob van der Linden 022b4209a3
nixos: systemd: split off systemd-user into separate module 2022-03-17 23:16:37 +01:00
Bob van der Linden cae8ef1232
nixos: systemd-coredump: use cfg shorthand 2022-03-17 23:16:30 +01:00
Bob van der Linden ccfcb78a50
nixos: systemd: split off coredump into separate module 2022-03-17 23:15:49 +01:00
Bob van der Linden 7adc8ecac3
nixos: systemd-journald: use cfg shorthand 2022-03-17 23:13:36 +01:00
Bob van der Linden fee1e24b3b
nixos: systemd: split off journald into separate module 2022-03-17 23:13:36 +01:00
Bob van der Linden e2cb8903da
nixos: systemd-logind: use cfg shorthand 2022-03-17 23:13:27 +01:00
Bob van der Linden c647002a94
nixos: systemd: split off logind into separate module 2022-03-17 23:12:00 +01:00
Bob van der Linden 0c94a512dd
nixos: systemd: avoid using "with systemdUtils.lib" 2022-03-17 21:52:54 +01:00
Bob van der Linden 3420dba80a
nixos: systemd: move systemd-nspawn to systemd/nspawn 2022-03-17 21:52:37 +01:00
github-actions[bot] 739cf04cb7
Merge staging-next into staging 2022-03-17 18:02:05 +00:00
Luflosi 47b699fe6c
Revert "nixos/modprobe: add boot.initrd.extraModprobeConfig option"
This reverts commit 1c58cdbeed, since this change was made redundant by 3dc6fab5c9 and in https://github.com/NixOS/nixpkgs/pull/145013 we decided to revert this commit.
2022-03-17 12:56:02 +01:00
github-actions[bot] 2eac3106df
Merge staging-next into staging 2022-03-17 00:02:45 +00:00
Robert Hensing 0395086d0c
Merge pull request #162271 from Infinisil/warn-no-type
Throw an error for options without a type
2022-03-16 22:58:45 +01:00