Commit graph

1873 commits

Author SHA1 Message Date
Yuka ce54a4f658
nixos/networkd: add RoutingPolicyRule Type option (#146168) 2021-12-07 10:13:22 +01:00
pennae c694c35f9d nixos/*: escape pkgs reference in examples and descriptions 2021-12-06 00:38:05 +01:00
Janne Heß b30d619368
nixos/top-level: Check syntax of switch-to-configuration 2021-12-05 18:54:36 +01:00
Janne Heß 6f1e0dc34f
nixos/switch-to-configuration: Move excludes up 2021-12-05 18:54:19 +01:00
Janne Heß 5d34545954
nixos/switch-to-configuration: Ignore scopes 2021-12-05 18:47:35 +01:00
Janne Heß 1e422e7d58
nixos/switch-to-configuration: Fix dry order
This makes the order of the dry activation messages the same as the real
actions which makes more sense than another random order.
2021-12-05 18:46:50 +01:00
Janne Heß 3693e8b093
nixos/switch-to-configuration: Clean perl code
oct() is recommended by perlcritic and the rest was unused.
2021-12-05 18:45:44 +01:00
Janne Heß 50a0f33c2a
nixos/switch-to-configuration: Remove unnecessary TODOs
The first one doesn't make any sense because the directory where the
init binary resides does not contain other tools we need like
systemd-escape.

The second one doesn't make sense either because the errors are already
ignored.
2021-12-05 18:43:42 +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
Robert Hensing 8a129f8cf0
Merge pull request #144094 from hercules-ci/nixos-specialisations-use-extendModules
nixos/specialisation: Rephrase in terms of extendModules, noUserModules
2021-12-01 11:03:36 +01: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
Sandro 61c3243dc7
Merge pull request #113887 from xaverdh/install-grub-editorconfig-fixup 2021-11-29 21:03:41 +01:00
Michael Weiss 1cfecb636b
Revert "Merge pull request #141192 from helsinki-systems/feat/improved-socket-handling2"
This reverts commit 57961d2b83, reversing
changes made to b04f913afc.
(I.e. this reverts PR #141192.)

While well-intended, this change does unfortunately introduce very
serious regressions that are especially disruptive/noticeable on desktop
systems (e.g. users of Sway will loose their graphical session when
running "nixos-rebuild switch").

Therefore, this change has to be reverted ASAP instead of trying to fix
it in "production".
Note: An updated version should be extensively discussed, reviewed, and
tested before re-landing this change as an earlier version also had to
be reverted for the exact same issues [0].

Fix: #146727

[0]: https://github.com/NixOS/nixpkgs/pull/73871#issuecomment-559783752
2021-11-27 17:22:22 +01:00
Dominik Xaver Hörl 0360e03520 nixos/install-grub: fix whitespace
This time hopefully without changing the generated boot script.
2021-11-27 10:18:21 +01:00
Dominik Xaver Hörl 19447850a2 Revert "nixos/install-grub: normalize whitespace"
This morally reverts commit 0e8d7f9b3d.
It made the generated boot script hard to read.
2021-11-27 10:18:04 +01:00
github-actions[bot] 28641f51dc
Merge master into staging-next 2021-11-22 18:01:08 +00:00
Artturin 7f24a5ff35 nixos/systemd: readd dbus-org.freedesktop.login1.service to upstreamSystemUnits
it was removed in
eb862c48dd (diff-5ea4693beb4bdd8f7efcdd3204ceea67c86f59b3d1c28cde063ddf03e1d20fbfL66)

without this change i get
Failed to list users: Unit dbus-org.freedesktop.login1.service not found.
when i update and rebuild
2021-11-22 05:59:05 +02:00
github-actions[bot] 18ad263272
Merge master into staging-next 2021-11-21 18:01:07 +00:00
Ryan Burns 2175b157ac treewide: refactor isi686 && isx86_64 -> isx86 2021-11-20 17:50:41 -08:00
Will Fancher 851495a752 Move systemd-lib.nix and systemd-unit-options.nix into utils 2021-11-20 17:52:29 -05:00
github-actions[bot] 90829d83e5
Merge master into staging-next 2021-11-17 00:01:49 +00:00
n0emis eeac1c543d
nixos/networkd: add BatmanAdvanced options (#145963)
Since systemd v248 networkd supports BatmanAdvanced.
This adds the according config options to the networkd-module
2021-11-16 23:41:17 +01:00
github-actions[bot] cfaff97318
Merge staging-next into staging 2021-11-15 18:01:43 +00:00
Taeer Bar-Yam 0bef0c38f7 lib.modules: add mkDerivedConfig
mkDerivedConfig : Option a -> (a -> Definition b) -> Definition b

Create config definitions with the same priority as the definition of another option.
This should be used for option definitions where one option sets the value of another as a convenience.
For instance a config file could be set with a `text` or `source` option, where text translates to a `source`
value using `mkDerivedConfig options.text (pkgs.writeText "filename.conf")`.

It takes care of setting the right priority using `mkOverride`.
2021-11-15 07:03:41 -05:00
Taeer Bar-Yam 0e590c91d2 etc module: make .text and .source the same priority
Before this change, one could set environment.etc.*.text and .source.
.source would always take precedence, regardless of the priorities set.
This change means that if, for instance, .text is set with mkForce but
.source is set normally, the .text content will be the one to take
effect. If they are set with the same priority they will conflict.
2021-11-14 18:47:09 -05:00
github-actions[bot] d5964b8c81
Merge staging-next into staging 2021-11-10 00:02:09 +00:00
Christian Kögler 33ffba995d
NixOS: Document impurity issues with boot.binfmt.emulatedSystems (#142778)
* NixOS: Document impurity issues with boot.binfmt.emulatedSystems

* Update nixos/modules/system/boot/binfmt.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

* Update nixos/modules/system/boot/binfmt.nix

Co-authored-by: Moritz Hedtke <13287984+mohe2015@users.noreply.github.com>

* Update nixos/modules/system/boot/binfmt.nix

Co-authored-by: Moritz Hedtke <13287984+mohe2015@users.noreply.github.com>

* Update nixos/modules/system/boot/binfmt.nix

Co-authored-by: markuskowa <markus.kowalewski@gmail.com>

* Apply suggestions from code review

Co-authored-by: markuskowa <markus.kowalewski@gmail.com>

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Co-authored-by: Moritz Hedtke <13287984+mohe2015@users.noreply.github.com>
Co-authored-by: markuskowa <markus.kowalewski@gmail.com>
2021-11-09 21:49:45 +01:00
Florian Klink 6ae271565d
Merge pull request #140046 from jrobsonchase/systemd-boot/fix-regexp
nixos/systemd-boot: Fix installed version regexp
2021-11-06 12:24:32 +01:00
Josh Robson Chase 3efc2de6d1
nixos/systemd-boot: Use the correct version string from the bootctl --version output 2021-11-05 12:11:22 -04:00
Josh Robson Chase 4ddc78818e
nixos/systemd-boot: Re-add the verison check, but as equivalence-only 2021-11-05 12:11:21 -04:00
Josh Robson Chase 71ed9d096e
nixos/systemd-boot: Remove the installed version check altogether
bootctl does it as a part of its update process anyway, so we're just
duplicating code.
2021-11-05 12:11:20 -04:00
Josh Robson Chase 1d5ffa8cac
nixos/systemd-boot: Fix installed version regexp
The regexp was only matching numbers and not the '.', so everyone using
systemd-boot would always see `could not find any previously installed
systemd-boot` on a `nixos-rebuild`.
2021-11-05 12:11:19 -04:00
Maciej Krüger f37f1b2d01
Merge pull request #130388 from oxalica/fix/etc-nixos-tag-in-activation 2021-11-04 15:26:17 +01:00
Maciej Krüger 7667f641c9
systemd: disable systemd-udev-trigger.service in containers 2021-11-03 07:49:50 +01:00
Michael Fellinger cb3a0f55e8 stage2: use atomic bind mounts 2021-11-01 20:12:59 -07:00
Robert Hensing b5681a7a40 nixos/specialisation: Rephrase in terms of extendModules, noUserModules
By using the new extendModules function to produce the specialisations,
we avoid reimplementing the eval-config.nix logic in reverse and fix
cross compilation support for specialisations in the process.
2021-11-01 10:59:47 +01:00
Luke Granger-Brown 13fad0f81b nixos/systemd-boot: create boot entries for specialisations
Some specialisations (such as those which affect various boot-time
attributes) cannot be switched to at runtime. This allows picking the
specialisation at boot time.
2021-10-31 11:36:15 +00:00
Florian Klink 81715a5da0
Merge pull request #142570 from flokli/add-missing-cryptsetup-targets
nixos/systemd: add remote-cryptsetup.target
2021-10-25 12:51:27 +02:00
Artturi dfad31d753
Merge pull request #142273 from ju1m/display-managers 2021-10-23 03:58:21 +03:00
Florian Klink 0084c41abf nixos/systemd: add remote-cryptsetup.target
/etc/crypttab can contain the _netdev option, which adds crypto devices
to the remote-cryptsetup.target.

remote-cryptsetup.target has a dependency on cryptsetup-pre.target. So
let's add both of them.

Currently, one needs to manually ssh in and invoke `systemctl start
systemd-cryptsetup@<name>.service` to unlock volumes.

After this change, systemd will properly add it to the target, and
assuming remote-cryptsetup.target is pulled in somewhere, you can simply
pass the passphrase by invoking `systemd-tty-ask-password-agent` after
ssh-ing in, without having to manually start these services.

Whether remote-cryptsetup.target should be added to multi-user.target
(as it is on other distros) is part of another discussion - right now
the following snippet will do:

```
systemd.targets.multi-user.wants = [ "remote-cryptsetup.target" ];
```
2021-10-22 15:47:21 +02:00
Julien Moutinho 2ef7fec214 nixos/systemd-lib: fix cross-compiling 2021-10-21 03:55:36 +02:00
Hugo Lageneste e09fb63ffc nixos/luksroot: sync the crypt-storage
Add a sync command just after writing to the /crypt-storage file in order to reduce
the possibilities of corruption errors.
2021-10-20 03:46:19 +03:00
Janne Heß 4cdbb2d891
nixos/switch-to-configuration: Fix ordering and indentation
This makes the order of operations the same in dry-activate and a "true"
activate. Also fixes the indentation I messed up and drop a useless
unlink() call (we are already unlinking that file earlier).
2021-10-17 14:35:49 +02:00
Janne Heß ad09f7be14
nixos/switch-to-configuration: Handle stopped sockets
The previous logic failed to detect that units were socket-activated
when the socket was stopped before switch-to-configuration was run. This
commit fixes that and also starts the socket in question.
2021-10-17 14:35:48 +02:00
Janne Heß 558158b4f5
nixos/switch-to-configuration: Hide socket warnings 2021-10-17 14:35:48 +02:00
Janne Heß 047aa1a0e9
nixos/switch-to-configuration: Use early return 2021-10-17 14:35:47 +02:00
Janne Heß 4f870c7d70
nixos/switch-to-configuration: Restart timers 2021-10-17 14:35:47 +02:00
Janne Heß adc033cd59
nixos/switch-to-configuration: Ignore path units 2021-10-17 14:35:46 +02:00
Janne Heß de128feacc
nixos/switch-to-configuration: Ignore slice units 2021-10-17 14:35:46 +02:00
Janne Heß b515bae5cf
nixos/switch-to-configuration: Remove some FIXMEs
The first FIXME is removed because it doesn't make sense to use
/proc/1/exe since that points to a directory that doesn't have all tools
the activation script needs (like systemd-escape).

The second one is removed because there is already no error handling
(compare with the restart logic where the return code is checked).
2021-10-17 14:35:45 +02:00
Janne Heß cfad5e3403
nixos/switch-to-configuration: Improve socket support
This commit changes a lot more that you'd expect but it also adds a lot
of new testing code so nothing breaks in the future. The main change is
that sockets are now restarted when they change. The main reason for
the large amount of changes is the ability of activation scripts to
restart/reload units. This also works for socket-activated units now,
and honors reloadIfChanged and restartIfChanged. The two changes don't
really work without each other so they are done in the one large commit.

The test should show what works now and ensure it will continue to do so
in the future.
2021-10-17 14:35:43 +02:00
Janne Heß 744162ffb6
nixos/switch-to-configuration: Fix perlcritic warning 2021-10-17 14:33:42 +02:00
Janne Heß c4d34cd184
nixos/top-level: Check Syntax of switch-to-configuration 2021-10-17 14:33:42 +02:00
Janne Heß f0a31f9b9f
nixos/switch-to-configuration: Ignore started scopes
They are not managed by us and it might be weird to users to see units
they didn't expect to be started.
2021-10-17 14:33:42 +02:00
Janne Heß ec619ca369
nixos/switch-to-configuration: Remove unused variable 2021-10-17 14:33:41 +02:00
pennae f29ea2d15d nixos/networking: add foo-over-udp endpoint support
allows configuration of foo-over-udp decapsulation endpoints. sadly networkd
seems to lack the features necessary to support local and peer address
configuration, so those are only supported when using scripted configuration.
2021-10-16 20:48:03 -04:00
Vladimir Serov a868222d65
nixos.system.boot.kernel: stronger constraints for kernelParam type
Checks whether all spaces are inside double quotes, thus ensuring that one
string parses as no more than one kernel param.

Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
2021-10-16 01:21:10 +03:00
Graham Christensen a997f198a3
Merge pull request #139833 from flox/multipath
nixos/multipath: add module for multipath-tools package
2021-10-13 09:58:25 -04:00
Joerie de Gram 7bd84b6685 systemd-boot: add 'graceful' configuration option
On some systems bootctl cannot write the `LoaderSystemToken` EFI variable
during installation, which results in a failure to install the boot
loader. Upstream provides a flag (--graceful) to ignore such write failures -
this change exposes it as a configuration option.

As the exact semantics of this option appear to be somewhat volatile it
should be used only if systemd-boot otherwise fails to install.
2021-10-11 15:14:33 +02:00
Michael Brantley 121cfd1998 nixos/multipath: add multipath module
The multipath-tools package had existed in Nixpkgs for some time but
without a nixos module to configure/drive it. This module provides
attributes to drive the majority of multipath configuration options
and is being successfully used in stage-1 and stage-2 boot to mount
/nix from a multipath-serviced iSCSI volume.

Credit goes to @grahamc for early contributions to the module and
authoring the NixOS module test.
2021-10-08 09:47:38 -04:00
Graham Christensen 829bbc708b boot.initrd.extraFiles: allow users to add arbitrary files to the initrd 2021-10-08 09:47:01 -04:00
Andreas Rammhold 0873980dc8
Merge pull request #139754 from eyJhb/networkd-iaid
nixos/networkd: added IAID, DUIDType and DUIDRawData to DHCPv6 section
2021-10-05 10:06:05 +02:00
Naïm Favier 2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Robert Hensing c3bf08d1b0
Merge pull request #139431 from erikarvstedt/etc-simplify-source
nixos/etc: simplify source path handling
2021-10-03 00:50:39 +02:00
eyjhb 4b8bd41060
nixos/networkd: added IAID, DUIDType and DUIDRawData to DHCPv6 section 2021-09-28 15:33:06 +02:00
Jörg Thalheim 59cb7a87d7
Merge pull request #137124 from helsinki-systems/feat/activation-script-restart
nixos/switch-to-configuration: Allow activation scripts to restart units
2021-09-26 15:46:38 +01:00
Leo Maroni e95a50a64b
nixos/networkd: add ActivationPolicy option 2021-09-25 16:03:42 +02:00
Erik Arvstedt 654f41435b
nixos/etc: simplify source path handling
This change is strictly functionally equivalent because we're just
lifting the transformation of `source` out of `mapAttrs` to the single point of
use (in escapeShellArgs).

This is also much faster because we can skip a map over all `etc` items.
2021-09-25 14:44:38 +02:00
Artturi e7b6d118f2
Merge pull request #113241 from chkno/user-activation-scripts
Run userActivationScripts at login
2021-09-18 05:25:06 +03:00
Artturi 74b3e9ff87
Merge pull request #136471 from Artturin/tmpontmpfssize 2021-09-16 02:25:02 +03:00
github-actions[bot] 728f30ca03
Merge master into staging-next 2021-09-15 00:01:33 +00:00
github-actions[bot] 91c89490cc
Merge master into staging-next 2021-09-14 18:01:05 +00:00
ajs124 9c566248df
Merge pull request #137508 from helsinki-systems/fix/dry-activation
nixos/activation-script: Fix dependencies for dry activation
2021-09-14 15:55:37 +02:00
Guillaume Girol 9739ba6baf nixos/systemd: create a group for systemd-coredump
Fixes:
```
activating the configuration...
warning: user ‘systemd-coredump’ has unknown group ‘systemd-coredump’
setting up /etc...
```

Oversight of #133166
2021-09-14 12:00:00 +00:00
github-actions[bot] 1db0c42d5a
Merge master into staging-next 2021-09-14 00:01:23 +00:00
Guillaume Girol 3592034595
Merge pull request #133166 from symphorien/nonogroup
Don't default to nogroup for the primary group of users.
2021-09-13 18:29:21 +00:00
Jonathan Ringer ca1731455d
Merge remote-tracking branch 'origin/master' into staging-next 2021-09-13 08:09:52 -07:00
Alyssa Ross 0f279e2e0c nixos/top-level: fix cross
When cross-compiling, we can't run the runtime shell to check syntax
if it's e.g. for a different architecture.  We have two options here.
We can disable syntax checking when cross compiling, but that risks
letting errors through.  Or, we can do what I've done here, and change
the syntax check to use stdenv's shell instead of the runtime shell.
This requires the stdenv shell and runtime shell to be broadly
compatible, but I think that's so ingrained in Nixpkgs anyway that
it's fine.  And this way we avoid conditionals that check for cross.
2021-09-13 11:13:38 +00:00
Guillaume Girol bc3bca822a nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
Janne Heß 4db13430fb
nixos/activation-script: Fix dependencies for dry activation 2021-09-12 11:34:13 +02:00
github-actions[bot] fc5d1c0828
Merge master into staging-next 2021-09-09 12:01:24 +00:00
Janne Heß e8388f8574
nixos/switch-to-configuration: Allow activation scripts to restart units
The primary use case is tools like sops-nix and agenix to restart units
when secrets change. There's probably other reasons to restart units as
well and a nice thing to have in general.
2021-09-09 13:11:52 +02:00
Janne Heß 2bcd3dad86
nixos/top-level: Check activation script syntax 2021-09-08 20:08:44 +02:00
github-actions[bot] 31efc58eb0
Merge master into staging-next 2021-09-08 18:01:03 +00:00
Artturin f45e8d560e nixos/tmp: add tmpOnTmpfsSize 2021-09-08 19:30:52 +03:00
Lassulus 5f4004ea94
Merge pull request #136605 from helsinki-systems/feat/dry-activation-scripts
nixos: Add dry activation for users/groups
2021-09-08 18:10:09 +02:00
Alyssa Ross 071a7a4583
Merge remote-tracking branch 'nixpkgs/master' into staging-next 2021-09-03 18:23:45 +00:00
Janne Heß 3156730402
nixos/switch-to-configuration: Add dry activation scripts 2021-09-03 18:40:11 +02:00
Graham Christensen 3677d4bc22 kexec-tools: rename from kexectools to match the project name 2021-09-03 10:17:21 -04:00
github-actions[bot] 0630061ef3
Merge master into staging-next 2021-09-02 18:01:20 +00:00
Matthias Treydte 9ce8df127d nixos/etc: make sure local "source" files are imported to the store
The treatment of the "source" parameter changed
with eb7120dc79, breaking stuff.

Before that commit, the source parameter was converted to a
string by implicit coercion, which would copy the file to the
store and yield an string containing the store path. Now, by
the virtue of escapeShellArg, toString is called explicitly on
that path, which will yield an string containing the absolute
path of the file.

This commit restores the old behavior.
2021-09-02 15:50:44 +02:00
github-actions[bot] b13b005f0e
Merge master into staging-next 2021-08-26 12:01:09 +00:00
hyperfekt d5b9aefa43 stage-1: fix copytoram option for loopback.cfg boot
Uses an alternative method to find the size of the ISO when it is a file and
not a block device for creating the tmpfs its contents are copied to.
2021-08-25 01:35:31 +00:00
Jan Tojnar 7a04c2ad68 Merge branch 'staging-next' into staging
- boost 171 removed on staging-next
- re-generated node-packages.nix

; Conflicts:
;	pkgs/development/java-modules/m2install.nix
;	pkgs/development/node-packages/node-packages.nix
;	pkgs/top-level/all-packages.nix
2021-08-22 01:13:41 +02:00
Timothy DeHerrera 3cc7e2f037
Merge pull request #115927 from input-output-hk/fix-deleted-sockets-restart
nixos/switch-to-configuration: don't try restart deleted sockets
2021-08-20 08:33:42 -06:00
Timothy DeHerrera 066bcd954f
Merge pull request #117476 from jbgi/systemd-journald@
nixos/systemd: add namespaced (templated) journald sockets and service
2021-08-20 08:32:05 -06:00
Jan Tojnar e286e1cfa0 Merge branch 'staging-next' into staging
- boost 167 removed on staging-next (7915d1e03f) × boost attributes are inherited on staging (d20aa4955d)

- linux kernels were moved to linux-kernels.nix on staging-next (c62f911507) × hardened kernels are versioned on staging (a5341beb78) + removed linux_5_12 (e55554491d)

- conflict in node-packages – I regenerated it using node2nix from nixos-unstable (does not build on staging)
2021-08-17 18:52:37 +02:00
Jörg Thalheim 4df44299d6
Merge pull request #73780 from h0m1/fixnix/stage-1
stage-1: create temporary secrets directory in /tmp and not in cwd
2021-08-17 06:33:42 +01:00
Jörg Thalheim f251e39c45
Merge pull request #128134 from xaverdh/linux-package-set
move linux packages out of all-packages
2021-08-15 08:14:35 +01:00
Anderson Torres 5605b561ce
Merge pull request #109302 from SrTobi-Forks/tobias/grub-savedefault
nixos/grub: implements GRUB_SAVEDEFAULT feature
2021-08-14 10:35:16 -03:00
Dominik Xaver Hörl c62f911507 top-level: move linux kernels, packages and related functions to linux-kernels.nix 2021-08-12 12:22:03 +02:00
Guillaume Girol 71154a8a8a
Merge pull request #130519 from Mic92/journald
nixos/journald: don't set nogroup
2021-08-08 15:02:31 +00:00
Rouven Czerwinski 06667df72b
nixos/etc: use runCommandLocal (#133037)
Instead of setting preferLocalBuild & allowSubstitutes explicitly, use
runCommandLocal which sets the same options.
2021-08-07 14:56:21 -04:00
Jörg Thalheim f0672fa7fb
Merge pull request #129413 from ngkz/binfmt-order-fix
nixos/binfmt: run binfmt activation script after mounting /run
2021-08-03 12:20:17 +01:00
Florian Klink b8662b8dba
Merge pull request #131948 from flokli/systemd-coredump-user
nixos/systemd: provision a systemd-coredump user
2021-08-02 16:14:49 +02:00
Jörg Thalheim 4dba1b99ec
Merge pull request #131102 from helsinki-systems/feat/rework-etc-2
nixos/etc: Replace make-etc.sh with nix and bash
2021-07-31 03:57:59 +01:00
Janne Heß eb7120dc79
nixos/etc: Replace make-etc.sh with nix and bash
The main goal of this commit is to replace the rather fragile passing of
multiple arrays which could break in cases like #130935.
While I could have just added proper shell escaping to the variables
being passed, I opted for the more painful approach of replacing the
fragile and somewhat strange construct with the 5 bash lists. While
there are currently no more problems present with the current approach
(at least none that I know of), the new approach seems more solid and
might get around problems that could arise in the future stemming from
either the multiple-lists situation or from the absence of proper shell
quoting all over the script.
2021-07-30 21:33:13 +02:00
Florian Klink 7293489288 nixos/systemd: provision a systemd-coredump user
systemd-coredump tries to drop privileges to a systemd-coredump user if
present (and falls back to the root user if it's not available).

Create that user, and recycle uid 151 for it. We don't really care about
the gid.

Fixes https://github.com/NixOS/nixpkgs/issues/120803.
2021-07-29 15:00:24 +02:00
SrTobi eff8d3bdb1 nixos/grub: implements GRUB_SAVEDEFAULT feature
Grub will remember the configuration that was booted and
select it as default menu entry the next time (#108206).
2021-07-28 18:57:08 +02:00
Ben Siraphob b63a54f81c
Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
Dino A. Dai Zovi 30b97d7cca
nixos/stage1: copy initrd secrets into place after special mounts
This modifies initialRamdiskSecretAppender to stage secrets in
/.initrd-secrets/ and stage-1-init to copy them into place after mounting
special file systems. This allows secrets to be copied into ramfs mounts
like /run/keys for use after stage-1 finishes without copying them to disk
(which would not be very secure).
2021-07-18 18:27:21 +00:00
Jörg Thalheim ad59e62780 nixos/journald: don't set nogroup 2021-07-18 08:46:54 +02:00
Florian Klink c1536f5c78 nixos/systemd: fix NSS database ordering
- The order of NSS (host) modules has been brought in line with upstream
  recommendations:

  - The `myhostname` module is placed before the `resolve` (optional) and `dns`
    entries, but after `file` (to allow overriding via `/etc/hosts` /
    `networking.extraHosts`, and prevent ISPs with catchall-DNS resolvers from
    hijacking `.localhost` domains)
  - The `mymachines` module, which provides hostname resolution for local
    containers (registered with `systemd-machined`) is placed to the front, to
    make sure its mappings are preferred over other resolvers.
  - If systemd-networkd is enabled, the `resolve` module is placed before
    `files` and `myhostname`, as it provides the same logic internally, with
    caching.
  - The `mdns(_minimal)` module has been updated to the new priorities.

  If you use your own NSS host modules, make sure to update your priorities
  according to these rules:

  - NSS modules which should be queried before `resolved` DNS resolution should
    use mkBefore.
  - NSS modules which should be queried after `resolved`, `files` and
    `myhostname`, but before `dns` should use the default priority
  - NSS modules which should come after `dns` should use mkAfter.
2021-07-17 23:55:35 +02:00
oxalica cba8b52942
Check and create /etc/NIXOS during activation 2021-07-17 01:55:00 +08:00
Kreyren ca3b4ce3d2
systemd.tmpfiles.rules: Fix false info
As per https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html the current description is missleading as it fails to mention volatile files and creation with deletion
2021-07-08 15:36:30 +02:00
Kazutoshi Noguchi bf22778585 nixos/binfmt: run binfmt activation script after mounting /run
binfmt activation script creates /run/binfmt before mounting /run
when system activation.

To fix it I added dependency to specialfs to binfmt activation
script.
2021-07-06 17:18:33 +09:00
Naïm Favier c0b2241e53
nixos/top-level: pass lib to specialisations 2021-07-03 13:05:55 +02:00
Markus S. Wamser 8e48b24d76 modules/luksroot: add note about AE to allowDiscards 2021-07-01 23:37:07 +02:00
Jörg Thalheim f75e2a648c
Merge pull request #128023 from max-privatevoid/patch-1
nixos/systemd-boot: Use os.path.realpath to fully resolve symlinks
2021-07-01 07:17:50 +01:00
Max 2cf6f9e5bd
nixos/systemd-boot: Use os.path.realpath to fully resolve symlinks
os.readlink only resolves one layer of symlinks. This script explicitly relies on the real path of a file for deduplication, hence symlink resolution should recurse.
2021-06-24 17:52:03 +02:00
Dominik Xaver Hörl 436f61c878 nixos/boot: properly override the kernel in boot.kernelPatches
Previously the code took the kernelPatches of the final derivation, which
might or might not be what was passed to the derivation in the original call.
The previous behaviour caused various hacks to become neccessary to avoid duplicates in kernelPatches.
2021-05-31 12:10:19 +02:00
Naïm Favier a6788be01a
nixos/luksroot: add bypassWorkqueues (#118114)
https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Disable_workqueue_for_increased_solid_state_drive_(SSD)_performance
2021-05-26 09:43:38 -04:00
Vincent Haupert faeb9e3233
nixos/networkd: add missing [DHCPServer] options
`systemd.network.networks.*.dhcpServerConfig` did not accept all of
the options which are valid for networkd's [DHCPServer] section. See
systemd.network(5) of systemd 247 for details.
2021-05-17 18:30:37 +02:00
hyperfekt 3e3e763a07 nixos/systemd: enable systemd-pstore.service
As described in issue #81138, the Install section of upstream units is
currently ignored, so we make it part of the sysinit.target manually.
2021-05-09 23:21:51 +02:00
Silvan Mosberger 08d94fd2b0
Merge pull request #114374 from oxalica/lib/platform-support-check
lib.meta: introduce `availableOn` to check package availability on given platform
2021-05-08 03:54:36 +02:00
Pacman99 87c659ab94 nixos/top-level: specialArgs to specialisations 2021-05-06 16:04:08 -07:00
Luke Granger-Brown 2136e90fa3
Merge pull request #114637 from KaiHa/pr/fix-systemd-boot-builder
systemd-boot-builder.py: ignore profile names with invalid chars
2021-04-25 11:35:00 +01:00
Konrad Borowski 66b2aaf2eb Revert "nixos/systemd: provide libidn2 for systemd-resolved"
This patch is no longer necessary with systemd v247.3.

This reverts commit c674a51382.
2021-04-12 18:37:18 +02:00
github-actions[bot] 85b57e4446
Merge master into staging-next 2021-04-08 18:14:17 +00:00
ajs124 c6d4dae35d treewide: fix eval without aliases after 9378fdf87e 2021-04-08 13:33:09 +02:00
Jan Tojnar c04a14edd6 Merge branch 'master' into staging-next 2021-04-06 16:01:14 +02:00
Gabriel Ebner c709fd42d9 nixos/systemd: increase default numeric PID range 2021-04-03 10:11:52 +02:00
oxalica 354d262db8
lib.meta: introduce availableOn 2021-04-02 19:20:23 +08:00
rnhmjoj 61b7cab481
treewide: use perl.withPackages when possible
Since 03eaa48 added perl.withPackages, there is a canonical way to
create a perl interpreter from a list of libraries, for use in script
shebangs or generic build inputs. This method is declarative (what we
are doing is clear), produces short shebangs[1] and needs not to wrap
existing scripts.

Unfortunately there are a few exceptions that I've found:

  1. Scripts that are calling perl with the -T switch. This makes perl
  ignore PERL5LIB, which is what perl.withPackages is using to inform
  the interpreter of the library paths.

  2. Perl packages that depends on libraries in their own path. This
  is not possible because perl.withPackages works at build time. The
  workaround is to add `-I $out/${perl.libPrefix}` to the shebang.

In all other cases I propose to switch to perl.withPackages.

[1]: https://lwn.net/Articles/779997/
2021-03-31 21:35:37 +02:00
github-actions[bot] b9456ca263
Merge master into staging-next 2021-03-28 18:14:11 +00:00
Linus Heckemann 4aacd02d33
Merge pull request #115792 from ncfavier/patch-2
nixos/stage-1: make cpio quiet
2021-03-28 14:38:46 +02:00
Jean-Baptiste Giraudeau 1665c5290c
nixos/systemd: add namespaced (templated) journald sockets and service 2021-03-24 16:57:33 +01:00
github-actions[bot] 39e3812215
Merge master into staging-next 2021-03-23 06:18:02 +00:00
Peter Hoeg 6b815bbb99 nixos/systemd: missing a few units for KDE to use systemd 2021-03-23 09:44:34 +08:00
github-actions[bot] 11ee0bf5d7
Merge master into staging-next 2021-03-23 00:40:24 +00:00
Sander van der Burg 8fc9423565
Merge pull request #116455 from svanderburg/systemdunitpath
systemd: allow custom unit folders to be configured with SYSTEMD_UNIT…
2021-03-22 22:58:49 +01:00
Sander van der Burg 5c8ed06fc9 systemd: allow custom unit folders to be configured with SYSTEMD_UNIT_PATH 2021-03-22 20:41:12 +01:00
github-actions[bot] 933682b533
Merge master into staging-next 2021-03-20 18:19:30 +00:00
Jörg Thalheim 1fc14408ae
Merge pull request #108952 from Mic92/systemd-builder
nixos/systemd-boot: add typechecking
2021-03-20 16:05:27 +00:00
github-actions[bot] 29278dcf45
Merge staging-next into staging 2021-03-19 12:26:59 +00:00
Alexander Foremny 297b1ba320 Revert "nixos/systemd: Handle template overrides"
This reverts commit e3b90b6ccc.

This commit broke container tests and thus blocked channels from
advancing.
2021-03-19 09:05:33 +01:00
github-actions[bot] 8c03075f07
Merge staging-next into staging 2021-03-19 00:41:08 +00:00
Florian Klink 68d6ffc8d5
Merge pull request #115549 from adrianparvino/new-nixos-unstable
systemd: Handle template overrides
2021-03-16 23:05:11 +01:00
Jean-Baptiste Giraudeau 77b7d29bf8
nixos/switch-to-configuration: don't try restart deleted sockets 2021-03-11 11:34:16 +01:00
Adrian Parvin D. Ouano e3b90b6ccc nixos/systemd: Handle template overrides
Adding template overrides allows for custom behavior for specific
instances of a template. Previously, it was not possible to provide
bind mounts for systemd-nspawn. This change allows it.
2021-03-11 10:21:14 +08:00
Naïm Favier d4d5fc6bd7
nixos/stage-1: make cpio quiet 2021-03-10 17:46:53 +01:00
Florian Klink 7db55b3aa5
Merge pull request #115584 from grahamc/systemd-modprobe-service
systemd: add the modprobe service
2021-03-09 22:12:25 +01:00
Graham Christensen 0b52c40240
nixos/systemd: bring in modprobe@.service
It is broken: it looks for /sbin/modprobe, but it works anyway??
2021-03-09 12:38:54 -05:00
Linus Heckemann c762b1eaab
Merge pull request #90065 from wizeman/u/fix-config-merge
linux: make sure all config options have the same value
2021-03-08 21:34:59 +01:00
Ricardo M. Correia 6feb61233b linux: make sure all config options have the same value
Currently, kernel config options whose value is "yes" always override
options whose value is "no".

This is not always desired.

Generally speaking, if someone defines an option to have the value
"no", presumably they are disabling the option for a reason, so it's
not always OK to silently enable it due to another, probably unrelated
reason.

For example, a user may want to reduce the kernel attack surface and
therefore may want to disable features that are being enabled in
common-config.nix.

In fact, common-config.nix was already silently enabling options that
were intended to be disabled in hardened/config.nix for security
reasons, such as INET_DIAG.

By eliminating the custom merge function, these config options will
now use the default module option merge functions which make sure
that all options with the highest priority have the same value.

A user that wishes to override an option defined in common-config.nix
can currently use mkForce or mkOverride to do so, e.g.:

BINFMT_MISC = mkForce (option no);

That said, this is not going to be necessary in the future, because
the plan is for kernel config options defined in nixpkgs to use a
lower priority by default, like it currently happens for other module
options.
2021-03-07 18:27:14 +01:00
WORLDofPEACE 583f1a96b1
Merge pull request #114000 from worldofpeace/plymouth-bgrt
nixos/plymouth: use bgrt theme
2021-03-04 18:32:30 -05:00
Kai Harries e2be5dc1f4 systemd-boot-builder: gracefully ignore errors during entry creation
Catch and ignore errors during writing of the boot entries.  These
errors could stem from profile names that are not valid filenames on
vfat filesystems.

fixes #114552
2021-03-02 20:17:57 +01:00
Linus Heckemann 08fc5e317c
Merge pull request #111802 from twhitehead/init-symlinks
nixos/stage1: chroot stage 2 init exists check so symlink resolve
2021-03-02 13:32:26 +01:00
Florian Klink aed9171b1a
Merge pull request #111342 from veehaitch/systemd-networkd-options
nixos/networkd: add missing IPv6 options
2021-02-27 00:16:20 +01:00
WORLDofPEACE 9e84dc00b0 nixos/plymouth: use white nixos logo
This looks cohesive with the spinner in the bgrt theme.
2021-02-25 16:46:03 -05:00
WORLDofPEACE 6bd4f9a3c5 nixos/plymouth: use bgrt theme
The BGRT theme is probably a close as to "FlickerFree" we can
get without https://github.com/NixOS/nixpkgs/pull/74842.
It's more agnostic than the Breeze theme.

We also install all of themes provided by the packages, as it's possible
that one theme needs the ImageDir of another, and they're small files
anyways.

Lastly, how plymouth handles logo and header files is
a total mess, so hopefully when they have an actual release
we won't need to do all this symlinking.
2021-02-25 16:46:03 -05:00
WORLDofPEACE 726dd9804e nixos/plymouth: exit on missing theme
Much better to provide a helpful message than to
get an obscure sed message.
2021-02-25 16:46:03 -05:00
Tyson Whitehead aed7c9a22a
stage-1: accept init symlinks at any level 2021-02-25 15:58:18 -05:00
Edmund Wu f4208fe9f9 nixos/plymouth: use upstream defaults
https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/101
75204a2517/src/plymouthd.defaults
2021-02-25 15:18:49 -05:00
WORLDofPEACE 0c3514f782
Merge pull request #99011 from andersk/plymouth-label
nixos/plymouth: Add label plugin and a font to the initrd
2021-02-21 15:44:54 -05:00
Anders Kaseorg 9d21f1dfab nixos/plymouth: Add label plugin and a font to the initrd
This allows Plymouth to show the “NixOS 21.03” label under the logo at
startup like it already does at shutdown.

Fixes #59992.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-02-21 10:27:15 -08:00
Michele Guerini Rocco 19d715c573
Merge pull request #107382 from rnhmjoj/no-udev-settle
nixos/{networkd,dhcpcd}: remove udev-settle hack
2021-02-20 20:49:19 +01:00
Florian Klink 68496cb927
Merge pull request #113570 from xaverdh/remove-systemConfig
Remove system config kernel parameter
2021-02-19 20:43:07 +01:00
Guillaume Girol 56923181e9
Merge pull request #107402 from ctem/fix/luksroot-master
boot.initrd.luks: add reusePassphrases support for YubiKey 2FA
2021-02-19 15:42:45 +00:00
Sandro Jäckel c75d7d2f8c
nixos/grub: fix editor check 2021-02-18 22:25:57 +01:00
rnhmjoj 65325292da
nixos/stage-1: install networkd link files
Renaming an interface must be done in stage-1: otherwise udev will
report the interface as ready and network daemons (networkd, dhcpcd,
etc.) will bring it up. Once up the interface can't be changed and the
renaming will fail.

Note: link files are read directly by udev, so they can be used even
without networkd enabled.
2021-02-18 22:07:00 +01:00
rnhmjoj 15d6eacb15
nixos/{networkd,dhcpcd}: remove udev-settle hack
systemd-udev-settle is a terrible hack[1] and should never[2] ever[3]
used, seriously it's very bad. It was used as a stop-gap solution for
issue #39069, but thanks to PR #79532 it can be removed now.

[1]: https://github.com/systemd/systemd/issues/7293#issuecomment-592941764
[2]: https://github.com/NixOS/nixpkgs/issues/73095
[3]: https://github.com/NixOS/nixpkgs/issues/107341
2021-02-18 22:07:00 +01:00
Dominik Xaver Hörl 0e8d7f9b3d nixos/install-grub: normalize whitespace 2021-02-18 20:51:34 +01:00
Dominik Xaver Hörl 61d746a7d3 nixos: don't set systemConfig for stage-2
Since c4f910f550, this is no longer
needed, because stage-2 is already generated with the path hard wired anyway.
2021-02-18 12:48:08 +01:00
Arian van Putten 5276ebb5ee nixos: Get rid of systemConfig kernel parameter
It was introduced in c10fe14 but removed in c4f910f.

It remained such that people with older generations in their boot
entries could still boot those. Given that the parameter hasn't had any
use in quite some years, it seems safe to remove now.

Fixes #60184
2021-02-18 12:48:08 +01:00
Chuck df25ca8520 nixos/activation-script: Run userActivationScripts at login
Fixes https://github.com/NixOS/nixpkgs/issues/113240
2021-02-16 10:10:45 -08:00
Jan Beinke 97718a3584
nixos/systemd-lib: allow mkIf in unitOption
`unitOption` is only used inside of `attrsOf` wich is perfectly capable of
handling the attrsets from `mkIf`, though the checkUnitConfig test
forbids it. This commit weakens that restriction to allow the usage of
`mkIf` inside of `systemd.services.<name>.serviceConfig.<something>`
etc.
2021-02-11 22:18:21 +01:00
Ctem 1c9b2f18ce
boot.initrd.luks: fix case Yubikey -> YubiKey 2021-02-08 04:01:47 +09:00
Ctem 9e8781328e
boot.initrd.luks: add reusePassphrases support for YubiKey 2FA 2021-02-08 03:55:17 +09:00
Michele Guerini Rocco 237d5fa67a
Merge pull request #111452 from urbas/linuxPackages_rpi3-missing-ahci-module
system/boot: add includeDefaultModules option
2021-02-07 12:33:51 +01:00
Matej Urbas 2c769d7a6a system/boot: add includeDefaultModules option 2021-02-07 11:14:36 +00:00
Fritz Otlinghaus 56c42142ed Revert "nixos/top-level: add specialisation.<name>.configuration type"
This reverts commit 05fbc82771.
2021-02-05 17:49:06 +01:00
Ben Wolsieffer f413b2bc51 Revert "nixos/kernel.nix: ensure same kernel is used"
This reverts commit 78f915a002.
2021-02-03 20:31:22 -05:00
Fritz Otlinghaus 05fbc82771 nixos/top-level: add specialisation.<name>.configuration type 2021-02-03 16:27:22 -08:00
Luflosi cfb06016e8
nixos/availableKernelModules: add cherry hid
This adds support for Cherry USB keyboards at boot.
2021-02-01 18:25:18 +01:00
Dmitry Kalinkin 8468a9878c
Merge pull request #87856 from eadwu/kernel/same-kernel
nixos/kernel.nix: ensure same kernel is used
2021-01-30 22:13:02 -05:00
Vincent Haupert e6660ffe7f
nixos/networkd: rename ipv6PrefixDelegationConfig option to ipv6SendRAConfig
networkd's [IPv6PrefixDelegation] section and IPv6PrefixDelegation=
options have been renamed as [IPv6SendRA] and IPv6SendRA= in systemd
247.

Throws if the deprecated option ipv6PrefixDelegationConfig is used.
2021-01-30 14:54:11 +01:00
Vincent Haupert 735111487b
nixos/networkd: add ipv6AcceptRAConfig option
Adds `systemd.network.networks.*.ipv6AcceptRAConfig` for networkd's
[IPv6AcceptRA] section.
2021-01-30 14:06:44 +01:00
Vincent Haupert 38f19af769
nixos/networkd: add dhcpV6PrefixDelegationConfig option
networkd gained a new section [DHCPv6PrefixDelegation] which
controls delegated prefixes assigned by DHCPv6 client. Added in systemd
246.
2021-01-30 14:06:27 +01:00
Vincent Haupert 53033aaf5a
nixos/networkd: add missing dhcpV6Config options 2021-01-30 12:50:22 +01:00
Matthew Bauer 6307346fd9
Merge pull request #98858 from sorki/cross/rpifw
raspberrypi-builder: allow passing firmware package as argument
2021-01-29 10:21:32 -06:00
Anderson Torres 79256619ce
Merge pull request #108294 from GovanifY/silent-boot
boot.initrd: add verbose option
2021-01-29 11:56:20 -03:00
Ben Siraphob 1c2a2b0a08 treewide: fold -> foldr 2021-01-26 10:57:07 +07:00
John Ericson e34a53c4ea
Merge pull request #110803 from Ericson2314/fix-nixos-misc-linux-config
nixos treewide: Fix references to linux-kernel.target
2021-01-25 13:39:20 -05:00
John Ericson 63b02e55db nixos treewide: Fix references to linux-kernel.target
Thanks @ajs124 in
https://github.com/NixOS/nixpkgs/pull/110544#discussion_r563828722 for
catching this. According to:

    git grep 'inherit.*Platform.*platform'
    git grep ' linux-kernel'

We now don't have any remaining problems of this sort, thankfully.
2021-01-25 13:06:12 -05:00
Matthew Bauer e8338c9c1d
Merge pull request #110739 from matthewbauer/fix-binfmt-nix-sandbox
nixos/binfmt: add bash to sandboxPaths
2021-01-25 11:53:27 -06:00
Matthew Bauer 35bd8f1153 nixos/binfmt: add bash to sandboxPaths
bash is needed to run the new binfmt shell script.

Fixes #110540
2021-01-24 22:47:59 -06:00
volth bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
Gauvain 'GovanifY' Roussel-Tarbouriech bc1b5fdfe0
boot.initrd: add verbose option 2021-01-24 07:16:21 +01:00
John Ericson 12881a7aa7
Merge pull request #110544 from Ericson2314/no-platform
top-level, lib: Remove platform attribute of platforms
2021-01-23 16:32:36 -05:00
Jörg Thalheim 17da58acca
Merge pull request #108242 from GovanifY/grub-additional
boot.loader.grub: add extraInstallCommands option
2021-01-23 16:18:22 +00:00
John Ericson 9c213398b3 lib: Clean up how linux and gcc config is specified
Second attempt of 8929989614589ee3acd070a6409b2b9700c92d65; see that
commit for details.

This reverts commit 0bc275e634.
2021-01-23 10:01:28 -05:00
Jonathan Ringer 0bc275e634
Revert "lib: Clean up how linux and gcc config is specified"
This is a stdenv-rebuild, and should not be merged
into master

This reverts commit 8929989614.
2021-01-22 14:07:06 -08:00
John Ericson d95aebbe0e
Merge pull request #107214 from Ericson2314/linux-config-cleanup
lib: Clean up how linux and gcc config is specified
2021-01-22 15:15:58 -05:00
Robert Hensing bbaff89ceb
Merge pull request #109976 from hercules-ci/systemd-allow-preStart-with-ExecStartPre
nixos/systemd: allow preStart with other ExecStartPre cmdlines
2021-01-22 10:18:11 +01:00
John Ericson 8929989614 lib: Clean up how linux and gcc config is specified
The `platform` field is pointless nesting: it's just stuff that happens
to be defined together, and that should be an implementation detail.

This instead makes `linux-kernel` and `gcc` top level fields in platform
configs. They join `rustc` there [all are optional], which was put there
and not in `platform` in anticipation of a change like this.

`linux-kernel.arch` in particular also becomes `linuxArch`, to match the
other `*Arch`es.

The next step after is this to combine the *specific* machines from
`lib.systems.platforms` with `lib.systems.examples`, keeping just the
"multiplatform" ones for defaulting.
2021-01-21 22:44:09 -05:00
Matthew Bauer da9fc7b068
Merge pull request #108072 from matthewbauer/fix-binfmt-activation
nixos/binfmt.nix: fix running commands in binfmt
2021-01-20 16:31:53 -06:00
Scriptkiddi 1572940688
networking, chrony, ntpd, timesyncd: add timeServers option type 2021-01-20 10:54:24 +01:00
Robert Hensing 3936d85ec3 nixos/systemd: allow preStart with other ExecStartPre cmdlines
Declaring them as lists enables the concatenation, supporting
lib.mkBefore, lib.mkOrder, etc.

This is useful when you need to extend a service with a pre-start
script that needs to run as root.
2021-01-19 16:29:29 +01:00
github-actions[bot] 9f69dadafd
Merge master into staging-next 2021-01-15 01:16:33 +00:00
Andreas Rammhold 3be09b94fb
Merge pull request #108860 from endocrimes/dani/fix-tmp
modules/boot: Specify the type for tmpfs mounts
2021-01-15 00:31:14 +01:00
Vladimír Čunát 9e2880e5fa
nixos ISO image: revert another part of 8ca33835ba 2021-01-13 15:25:19 +01:00
Vladimír Čunát 8ca33835ba
nixos: fixup build of aarch64 minimal ISO (fixes #109252)
Perhaps it's not pretty nor precise; feel free to improve.
2021-01-13 14:05:45 +01:00
Edmund Wu 78f915a002
nixos/kernel.nix: ensure same kernel is used
Originally, changes to the kernel don't propagate to the other
derivation within the same package set. This commit allows for the
changes in the kernel to be propagated.

A distinct example is setting `boot.kernel.randstructSeed` to a non-zero
length string which would result in building 2 kernels, one with the
correct seed and the other with the zero length seed. Then, when using
an out-of-tree kernel driver, it would be built with the zero length
seed which differs from the non-zero length seed used to boot,
contradicting the purpose of the `boot.kernel.randstructSeed`.
2021-01-11 12:57:34 -05:00
Jan Tojnar 2b9372b2ca
Merge branch 'master' into staging-next 2021-01-11 13:36:42 +01:00
Eelco Dolstra 187af93c19
Merge pull request #78430 from puckipedia/fix-initrd-silent
nixos/stage-1: Do not allow missing kernel modules in initrd
2021-01-11 13:18:45 +01:00
Jan Tojnar 88c998fb21
Merge branch 'staging-next' into staging 2021-01-10 23:24:57 +01:00
Jan Tojnar dd72357155
Merge branch 'master' into staging-next 2021-01-10 23:24:33 +01:00
Jörg Thalheim ceda1a5eee
nixos/systemd-boot: add typechecking 2021-01-10 21:13:59 +01:00
Dominik Xaver Hörl 25bef2d8f9 treewide: simplify pkgs.stdenv.lib -> pkgs.lib
The library does not depend on stdenv, that `stdenv` exposes `lib` is
an artifact of the ancient origins of nixpkgs.
2021-01-10 20:12:06 +01:00
Frederik Rietdijk b209617ff0 plasma5Packages: alias to the libsForQt5 used to build the plasma5 desktop
For in NixOS it is beneficial if both plasma5 and pam use the same Qt5
version. Because the plasma5 desktop may use a different version as the
default Qt5 version, we introduce plasma5Packages.
2021-01-10 15:59:45 +01:00
Danielle Lancashire ca7b35d2d9
modules/boot: Specify the type for tmpfs mounts
https://github.com/NixOS/nixpkgs/pull/107497 broke booting on many systems that
use tmpOnTmpfs due to the lack of specifying the mount type.

This commit explicitly adds the mount type, which should fix booting
such systems.

The original change may want to be revisited however too.
2021-01-09 15:32:17 +01:00
github-actions[bot] e251591528
Merge master into staging-next 2021-01-09 01:00:25 +00:00
Florian Klink 964c419bc0
Merge pull request #107497 from helsinki-systems/fix/tmp-mount
nixos/tmp: Make /tmp on ramdisk usable again
2021-01-08 23:54:46 +01:00
Gauvain 'GovanifY' Roussel-Tarbouriech 771ba47d56
boot.loader.grub: add extraInstallCommands option 2021-01-03 09:31:51 +01:00
Matthew Bauer 08135a3caa nixos/binfmt.nix: fix running commands in binfmt
To allow arguments in binfmt, we need to put the command in a shell
script. This uses exec to run the binfmt interpreter.

Fixes #90683
2020-12-31 13:28:01 -06:00
Blaž Hrastnik a6b5693a71 nixos/stage-1: set zstd as the default compressor when supported
Co-authored-by: Atemu <atemu.main@gmail.com>
2020-12-28 14:25:17 +01:00
Janne Heß 56d7e7492c
nixos/tmp: Make /tmp on ramdisk usable again
@poettering decided we only need a limited number of inodes in our /tmp,
so why not limit that for every systemd user? That makes medium-sized nix
builds impossible so this commit restores the old behaviour which is the
kernel default of half the number of physical RAM pages which does not
seem too unreasonable to me.
2020-12-26 13:13:41 +01:00
Florian Klink c674a51382 nixos/systemd: provide libidn2 for systemd-resolved
systemd started using dlopen() for some of their "optional"
dependencies.

Apparently, `libidn2` isn't so optional, and systemd-resolved doesn't
work without libidn2 present, breaking DNS resolution.

Fixes https://github.com/NixOS/nixpkgs/issues/107537

Upstream bug: https://github.com/systemd/systemd/issues/18078
2020-12-25 13:45:25 +01:00
Linus Heckemann 834cc5d5fa nixos/initrd: docbookise "compressor" description 2020-12-17 23:01:08 +01:00
Dominik Xaver Hörl d4ef25db5d nixos/initrd: add compressorArgs, make compressor option public 2020-12-17 11:38:10 +01:00
Linus Heckemann c14f14eeaf
Merge pull request #97505 from mayflower/grub-efi-mirroredboot
nixos/grub: allow multiple "nodev" devices for mirroredBoots
2020-12-04 18:37:50 +01:00
Frederik Rietdijk 0d8491cb2b Merge master into staging-next 2020-11-29 13:51:10 +01:00
Sarah Brofeldt a7a5f7904c
Merge pull request #99173 from johanot/fix-initrd-ssh-commands-test
nixos/initrd-ssh: set more defensive pemissions on sshd test key
2020-11-29 11:27:03 +01:00
Frederik Rietdijk b2a3891e12 Merge master into staging-next 2020-11-27 15:09:19 +01:00
Florian Klink 5b3a952e04
Merge pull request #102938 from cruegge/dev-symlinks
nixos/stage-1: create /dev/std{in,out,err} symlinks
2020-11-25 01:57:21 +01:00
Graham Christensen bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Florian Klink d22b3ed4bc systemd: switch to unified cgroup hierarchy by default
See https://www.redhat.com/sysadmin/fedora-31-control-group-v2 for
details on why this is desirable, and how it impacts containers.

Users that need to keep using the old cgroup hierarchy can re-enable it
by setting `systemd.unifiedCgroupHierarchy` to `false`.

Well-known candidates not supporting that hierarchy, like docker and
hidepid=… will disable it automatically.

Fixes #73800
2020-11-19 16:56:46 +01:00
Frederik Rietdijk 379aaa1e0c Merge master into staging-next 2020-11-10 10:11:08 +01:00
Michele Guerini Rocco e6b8587b25
Merge pull request #101755 from rnhmjoj/activation-type
nixos/activation-script: make scripts well-typed
2020-11-10 00:04:47 +01:00
Frederik Rietdijk 20f001c01e Merge master into staging-next 2020-11-09 14:33:52 +01:00
Jan Tojnar 8e7fca3a5c
nixos/plymouth: fix eval with aliases disabled
Fallout from https://github.com/NixOS/nixpkgs/pull/101369
2020-11-09 14:00:18 +01:00
Samuel Gräfenstein 88bf1b3e92 nixos/boot: add final newline to pbkdf2-sha512.c 2020-11-09 11:39:28 +00:00
Marek Mahut e02f6bfa26
Merge pull request #100418 from pltanton/master
fido2luks: 0.2.3 -> 0.2.15
2020-11-09 00:22:09 +01:00
Timo Kaufmann 1fd1c2ad88
Merge pull request #96639 from xfix/support-microsoft-usb-keyboards
nixos/availableKernelModules: add microsoft hid
2020-11-05 20:33:49 +01:00
Peter Hoeg 13ed0cce2f nixos/systemd-resolved: fix incorrect user 2020-11-05 22:41:39 +08:00
Christoph Ruegge bcc808c68f Create /dev/std{in,out,err} symlinks in stage-1
This used to be done by udev, but that was removed in
systemd/systemd@6b2229c. The links are created by systemd at the end of
stage-2, but activation scripts might need them earlier.
2020-11-05 15:32:19 +01:00
lf- 644079e707 nixos/modules: deprecation warning for StartLimitInterval in [Service]
This implements
https://github.com/NixOS/nixpkgs/issues/45786#issuecomment-440091879
2020-10-31 16:50:35 +01:00
Niklas Hambüchen c178fe4bbb nixos/modules: Reformat warnings section 2020-10-31 16:50:25 +01:00
lf- b37bbca521 nixos/modules: fix systemd start rate-limits
These were broken since 2016:
f0367da7d1
since StartLimitIntervalSec got moved into [Unit] from [Service].
StartLimitBurst has also been moved accordingly, so let's fix that one
too.

NixOS systems have been producing logs such as:
/nix/store/wf98r55aszi1bkmln1lvdbp7znsfr70i-unit-caddy.service/caddy.service:31:
Unknown key name 'StartLimitIntervalSec' in section 'Service', ignoring.

I have also removed some unnecessary duplication in units disabling
rate limiting since setting either interval or burst to zero disables it
(ad16158c10/src/basic/ratelimit.c (L16))
2020-10-31 01:35:56 -07:00
Graham Christensen 82578fc725
Merge pull request #102172 from grahamc/stage-1-datestamps
stage-1: add datestamps to logs
2020-10-30 16:13:02 -04:00
Graham Christensen b34cf366aa
Merge pull request #102171 from grahamc/faster-ext-resize
stage-1: modprobe ext{2,3,4} before resizing (so resizing takes less than 45 minutes)
2020-10-30 16:12:50 -04:00
Graham Christensen ece5c0f304
stage-1: modprobe ext{2,3,4} before resizing
I noticed booting a system with an ext4 root which expanded to 5T took
quite a long time (12 minutes in some cases, 43(!) in others.)

I changed stage-1 to run `resize2fs -d 62` for extra debug output and
timing information. It revealed the adjust_superblock step taking
almost all of the time:

    [Fri Oct 30 11:10:15 UTC 2020] zero_high_bits_in_metadata: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
    [Fri Oct 30 11:21:09 UTC 2020] adjust_superblock: Memory used: 396k/4556k (295k/102k), time: 654.21/ 0.59/ 5.13

but when I ran resize2fs on a disk with the identical content growing
to the identical target size, it would only take about 30 seconds. I
looked at what happened between those two steps in the fast case with
strace and found:

```
   235	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=1795}, ru_stime={tv_sec=0, tv_usec=3590}, ...}) = 0
   236	write(1, "zero_high_bits_in_metadata: Memo"..., 84zero_high_bits_in_metadata: Memory used: 132k/0k (72k/61k), time:  0.00/ 0.00/ 0.00
   237	) = 84
   238	gettimeofday({tv_sec=1604061278, tv_usec=480147}, NULL) = 0
   239	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=1802}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   240	gettimeofday({tv_sec=1604061278, tv_usec=480192}, NULL) = 0
   241	mmap(NULL, 2564096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c7355000
   242	access("/sys/fs/ext4/features/lazy_itable_init", F_OK) = 0
   243	brk(0xf85000)                           = 0xf85000
   244	brk(0xfa6000)                           = 0xfa6000
   245	gettimeofday({tv_sec=1604061278, tv_usec=538828}, NULL) = 0
   246	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=58720}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   247	write(1, "adjust_superblock: Memory used: "..., 79adjust_superblock: Memory used: 396k/2504k (305k/92k), time:  0.06/ 0.06/ 0.00
   248	) = 79
   249	gettimeofday({tv_sec=1604061278, tv_usec=539119}, NULL) = 0
   250	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=58812}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   251	gettimeofday({tv_sec=1604061279, tv_usec=939}, NULL) = 0
   252	getrusage(RUSAGE_SELF, {ru_utime={tv_sec=0, tv_usec=520411}, ru_stime={tv_sec=0, tv_usec=3603}, ...}) = 0
   253	write(1, "fix_uninit_block_bitmaps 2: Memo"..., 88fix_uninit_block_bitmaps 2: Memory used: 396k/2504k (305k/92k), time:  0.46/ 0.46/ 0.00
   254	) = 88
```

In particular the access to /sys/fs seemed interesting. Looking
at the source of resize2fs:

```
[root@ip-172-31-22-182:~/e2fsprogs-1.45.5]# rg -B2 -A1 /sys/fs/ext4/features/lazy_itable_init .
./resize/resize2fs.c
923-	if (getenv("RESIZE2FS_FORCE_LAZY_ITABLE_INIT") ||
924-	    (!getenv("RESIZE2FS_FORCE_ITABLE_INIT") &&
925:	     access("/sys/fs/ext4/features/lazy_itable_init", F_OK) == 0))
926-		lazy_itable_init = 1;
```

I confirmed /sys is mounted, and then found a bug suggesting the
ext4 module is maybe not loaded:
https://bugzilla.redhat.com/show_bug.cgi?id=1071909

My home server doesn't have ext4 loaded and had 3T to play with, so
I tried (and succeeded with) replicating the issue locally:

```
[root@kif:/scratch]# lsmod | grep -i ext

[root@kif:/scratch]# zfs create -V 3G rpool/scratch/ext4

[root@kif:/scratch]# time mkfs.ext4 /dev/zvol/rpool/scratch/ext4
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 786432 4k blocks and 196608 inodes
Filesystem UUID: 560a4a8f-93dc-40cc-97a5-f10049bf801f
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

real	0m2.261s
user	0m0.000s
sys	0m0.025s

[root@kif:/scratch]# zfs set volsize=3T rpool/scratch/ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4
resize2fs 1.45.5 (07-Jan-2020)
fs has 11 inodes, 1 groups required.
fs requires 16390 data blocks.
With 1 group(s), we have 22234 blocks available.
Last group's overhead is 10534
Need 16390 data blocks in last group
Final size of last group is 26924
Estimated blocks needed: 26924
Extents safety margin: 49
Resizing the filesystem on /dev/zvol/rpool/scratch/ext4 to 805306368 (4k) blocks.
read_bitmaps: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
read_bitmaps: I/O read: 1MB, write: 0MB, rate: 3802.28MB/s
fix_uninit_block_bitmaps 1: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
resize_group_descriptors: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
move_bg_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
zero_high_bits_in_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
```

here it got stuck for quite some time ... straceing this 20 minutes in revealed this in a tight loop:

```
getuid()                                = 0
geteuid()                               = 0
getgid()                                = 0
getegid()                               = 0
prctl(PR_GET_DUMPABLE)                  = 1 (SUID_DUMP_USER)
fallocate(3, FALLOC_FL_ZERO_RANGE, 2222649901056, 2097152) = 0
fsync(3)                                = 0
```

it finally ended 43(!) minutes later:

```
adjust_superblock: Memory used: 264k/3592k (210k/55k), time: 2554.03/ 0.16/15.07
fix_uninit_block_bitmaps 2: Memory used: 264k/3592k (210k/55k), time:  0.16/ 0.16/ 0.00
blocks_to_move: Memory used: 264k/3592k (211k/54k), time:  0.00/ 0.00/ 0.00
Number of free blocks: 755396/780023556, Needed: 0
block_mover: Memory used: 264k/3592k (216k/49k), time:  0.05/ 0.01/ 0.00
block_mover: I/O read: 1MB, write: 0MB, rate: 18.68MB/s
inode_scan_and_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
inode_ref_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
move_itables: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
calculate_summary_stats: Memory used: 264k/3592k (216k/49k), time: 16.35/16.35/ 0.00
fix_resize_inode: Memory used: 264k/3592k (222k/43k), time:  0.04/ 0.00/ 0.00
fix_resize_inode: I/O read: 1MB, write: 0MB, rate: 22.80MB/s
fix_sb_journal_backup: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
overall resize2fs: Memory used: 264k/3592k (222k/43k), time: 2570.90/16.68/15.07
overall resize2fs: I/O read: 1MB, write: 1MB, rate: 0.00MB/s
The filesystem on /dev/zvol/rpool/scratch/ext4 is now 805306368 (4k) blocks long.

real	43m1.943s
user	0m16.761s
sys	0m15.069s
```

I then cleaned up and recreated the zvol, loaded the ext4 module, created the ext4 fs,
resized the volume, and resize2fs'd and it went quite quickly:

```
[root@kif:/scratch]# zfs destroy rpool/scratch/ext4

[root@kif:/scratch]# zfs create -V 3G rpool/scratch/ext4

[root@kif:/scratch]# modprobe ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4

[root@kif:/scratch]# time mkfs.ext4 /dev/zvol/rpool/scratch/ext4
mke2fs 1.45.5 (07-Jan-2020)
Discarding device blocks: done
Creating filesystem with 786432 4k blocks and 196608 inodes
Filesystem UUID: 5b415f2f-a8c4-4ba0-ac1d-78860de77610
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

real	0m1.013s
user	0m0.001s
sys	0m0.023s

[root@kif:/scratch]# zfs set volsize=3T rpool/scratch/ext4

[root@kif:/scratch]# time resize2fs -d 62 /dev/zvol/rpool/scratch/ext4
resize2fs 1.45.5 (07-Jan-2020)
fs has 11 inodes, 1 groups required.
fs requires 16390 data blocks.
With 1 group(s), we have 22234 blocks available.
Last group's overhead is 10534
Need 16390 data blocks in last group
Final size of last group is 26924
Estimated blocks needed: 26924
Extents safety margin: 49
Resizing the filesystem on /dev/zvol/rpool/scratch/ext4 to 805306368 (4k) blocks.
read_bitmaps: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
read_bitmaps: I/O read: 1MB, write: 0MB, rate: 3389.83MB/s
fix_uninit_block_bitmaps 1: Memory used: 132k/0k (63k/70k), time:  0.00/ 0.00/ 0.00
resize_group_descriptors: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
move_bg_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
zero_high_bits_in_metadata: Memory used: 132k/0k (68k/65k), time:  0.00/ 0.00/ 0.00
adjust_superblock: Memory used: 264k/1540k (210k/55k), time:  0.02/ 0.02/ 0.00
fix_uninit_block_bitmaps 2: Memory used: 264k/1540k (210k/55k), time:  0.15/ 0.15/ 0.00
blocks_to_move: Memory used: 264k/1540k (211k/54k), time:  0.00/ 0.00/ 0.00
Number of free blocks: 755396/780023556, Needed: 0
block_mover: Memory used: 264k/3592k (216k/49k), time:  0.01/ 0.01/ 0.00
block_mover: I/O read: 1MB, write: 0MB, rate: 157.11MB/s
inode_scan_and_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
inode_ref_fix: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00
move_itables: Memory used: 264k/3592k (216k/49k), time:  0.00/ 0.00/ 0.00

calculate_summary_stats: Memory used: 264k/3592k (216k/49k), time: 16.20/16.20/ 0.00
fix_resize_inode: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
fix_resize_inode: I/O read: 1MB, write: 0MB, rate: 5319.15MB/s
fix_sb_journal_backup: Memory used: 264k/3592k (222k/43k), time:  0.00/ 0.00/ 0.00
overall resize2fs: Memory used: 264k/3592k (222k/43k), time: 16.45/16.38/ 0.00
overall resize2fs: I/O read: 1MB, write: 1MB, rate: 0.06MB/s
The filesystem on /dev/zvol/rpool/scratch/ext4 is now 805306368 (4k) blocks long.

real	0m17.908s
user	0m16.386s
sys	0m0.079s
```

Success!
2020-10-30 12:18:23 -04:00
Graham Christensen a179781696
stage-1: add datestamps to logs
When the stage-1 logs get imported in to the journal, they all get
loaded with the same timestamp. This makes it difficult to identify
what might be taking a long time in early boot.
2020-10-30 12:16:35 -04:00
Florian Klink b8d59e93c8 nixos/networkd: allow RouteMetric= in [DHCPv6] section 2020-10-29 19:47:42 +01:00
rnhmjoj bc35565463 nixos/activation-script: make scripts well-typed 2020-10-26 13:33:12 +01:00
Anton Plotnikov 1321ae850c
fido2luks: 0.2.3 -> 0.2.15
Also remove interactive flag from initrd, because of broken io.
2020-10-23 11:03:31 +03:00
Marc 'risson' Schmitt 9e6bede5ab nixos/initrd-network: fix /etc/resolv.conf when multiple dns servers from DHCP
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2020-10-19 21:32:58 -07:00
Florian Klink 9d0d99f05b
Merge pull request #95746 from Mic92/cloud-init
cloud-init: 0.7.9 -> 20.2 (python3!)
2020-10-15 22:57:46 +02:00
Johan Thomsen 8f5949fd46 nixos/initrd-ssh: set more defensive pemissions on sshd test key
It looks like the test sshd key can never be used, because of too open
permissions. My guess is that the current test script works fine once
the user defined ssh-key has been copied into initrd.

At "nixos-install" however, the user specified host key is not present
in initrd yet and validation fails.

fixes #91486
2020-09-30 15:47:49 +02:00
Florian Klink 30ddfe6b95 Revert "nixos/systemd-boot: Temporarily ignore errors"
This reverts commit b32701bc54.

That fix has been included upstream in 246.5.
2020-09-27 16:45:27 +02:00
Richard Marko 9b06e9856b raspberrypi-builder: allow passing firmware package as argument 2020-09-26 14:26:16 +02:00
Jan Tojnar 6d518ddf77
Merge pull request #98503 from jtojnar/doc-prompts 2020-09-24 22:48:38 +02:00
Jan Tojnar e6ce041cae
nixos/doc: Improve code listings
By adding prompts and replaceables and removing unnecessary indentation.
2020-09-23 01:25:25 +02:00
Cole Helbling 4586810487
nixos/stage-1: set up /dev/fd
Otherwise, stage-2-init.sh will complain about not having access to
/dev/fd/62 as of systemd v246.

On IRC, flokli said:

    15:14 <flokli> cole-h: hmmm... I could imagine some of the setup inside /dev has been moved into other parts of systemd
    15:14 <flokli> And given we run systemd much later (outside initramfs only) it doesn't work properly here
    15:17 <flokli> We probably don't invoke udev correctly
2020-09-22 15:33:21 -07:00
Tethys Svensson b32701bc54 nixos/systemd-boot: Temporarily ignore errors
This is a temporary fix for #97433. A more proper fix has been
implemented upstream in systemd/systemd#17001, however until it gets
backported, we are stuck with ignoring the error.

After the backport lands, this commit should be reverted.
2020-09-10 20:56:04 +02:00
Linus Heckemann fdd944526c nixos/grub: allow multiple "nodev" devices for mirroredBoots
For UEFI setups, "device" will generally be the special value "nodev"
which represents not running grub-install at all. Using "nodev" for
boot mirrors should therefore be allowed.
2020-09-09 07:40:08 +02:00
Christian Kampka 2c6753f9d0
Revert "nixos/raspberrypi-builder: fix cross using buildPackages"
The commit enforces buildPackages in the builder but neglects
the fact that the builder is intended to run on the target system.
Because of that, the builder will fail when remotely building a
configuration eg. with nixops or nix-copy-closure.

This reverts commit a6ac6d00f9.
2020-09-08 20:14:13 +02:00
Frederik Rietdijk af81d39b87 Merge staging-next into staging 2020-09-04 20:03:30 +02:00
Anders Kaseorg f4b2c9dfe7 cryptsetup, lvm2, systemd: Break cyclic dependency at a different point
The cyclic dependency of systemd → cryptsetup → lvm2 → udev=systemd
needs to be broken somewhere.  The previous strategy of building
cryptsetup with an lvm2 built without udev (#66856) caused the
installer.luksroot test to fail.  Instead, build lvm2 with a udev built
without cryptsetup.

Fixes #96479.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-09-03 12:35:56 -07:00
Janne Heß 8cf4ec8b97
nixos/systemd: Don't use apply for $PATH
When not using apply, other modules can use $PATH as a list instead of
getting a colon-separated list to each /bin directory.
2020-09-03 20:27:55 +02:00
WORLDofPEACE 18348c7829
Merge pull request #96042 from rnhmjoj/loaOf
treewide: completely remove types.loaOf
2020-09-02 08:45:37 -04:00
Orivej Desh 1a68e21d47
nixos/systemd: support adding and overriding tmpfiles.d via environment.etc (#96766)
This allows the user to configure systemd tmpfiles.d via
`environment.etc."tmpfiles.d/X.conf".text = "..."`, which after #93073
causes permission denied (with new X.conf):

```
ln: failed to create symbolic link '/nix/store/...-etc/etc/tmpfiles.d/X.conf': Permission denied
builder for '/nix/store/...-etc.drv' failed with exit code 1
```

or collision between environment.etc and systemd-default-tmpfiles
packages (with existing X.conf, such as tmp.conf):

```
duplicate entry tmpfiles.d/tmp.conf -> /nix/store/...-etc-tmp.conf
mismatched duplicate entry /nix/store/...-systemd-246/example/tmpfiles.d/tmp.conf <-> /nix/store/...-etc-tmp.conf
builder for '/nix/store/...-etc.drv' failed with exit code 1
```

Fixes #96755
2020-09-02 02:54:11 +00:00
rnhmjoj 20d491a317
treewide: completely remove types.loaOf 2020-09-02 00:42:50 +02:00
Konrad Borowski bcc93f02d2 nixos/availableKernelModules: add microsoft hid
This adds support for Microsoft USB keyboards at boot.
2020-08-29 22:28:54 +02:00
Matthew Bauer 25ac498482
Merge pull request #96404 from matthewbauer/gcc-cross
Fix cycle detected in Darwin->Linux cross GCC
2020-08-26 16:17:14 -05:00
Lassulus e453860b8f
Merge pull request #86236 from ThibautMarty/fix-nullOr-types
treewide: fix modules options types where the default is null
2020-08-26 18:21:29 +02:00
Frederik Rietdijk 081bd762e5 Merge staging-next into staging 2020-08-26 08:43:29 +02:00
Frederik Rietdijk f6286dea88 extra-utils: build a full lvm2 without udev support, fixes #96197
dmsetup was missing symbols.
https://github.com/NixOS/nixpkgs/pull/96290#issuecomment-680252830
2020-08-26 08:39:01 +02:00
Linus Heckemann 27f0ca6670 stage-1 find-libs: initialise left to empty array
declare -a is not sufficient to make the array variable actually
exist, which resulted in the script failing when the target object did
not have any DT_NEEDED entries. This in turn resulted in some
initramfs libraries not having their rpaths patched to point to
extra-utils, which in turn broke the extra-utils tests.
2020-08-25 12:10:30 +02:00
Florian Klink 40d2968ebf
Merge pull request #94354 from flokli/systemd-246
systemd: 245.6 -> 246
2020-08-24 12:42:24 +02:00
Jan Tojnar 91104b5417
Merge branch 'master' into staging-next 2020-08-23 02:00:50 +02:00
Lassulus 6a2c73031a
Merge pull request #89353 from wizeman/u/fix-zfs-ebusy
stage-1: retry mounting ZFS root a few times
2020-08-22 15:42:32 +02:00
Jörg Thalheim 4b9a2e13a8
cloud-utils: split of smaller .guest output 2020-08-18 11:37:41 +01:00
Frederik Rietdijk 0ac85bc455 Merge master into staging-next 2020-08-17 14:54:39 +02:00
Florian Klink 36a162edc3
Merge pull request #95342 from flokli/systemd-initctl
nixos/systemd: don't try to install systemd-initctl.{service,socket}
2020-08-16 17:17:18 +02:00
Vladimír Čunát 3937923f81
nixos/systemd.tmpfiles.packages: fix an edge case
symlinkJoin can break (silently) when the passed paths contain symlinks
to directories.  This should work now.

Down-side: when lib/tmpfiles.d doesn't exist for some passed package,
the error message is a little less explicit, because we never get
to the postBuild phase (and symlinkJoin doesn't provide a better way):
/nix/store/HASH-NAME/lib/tmpfiles.d: No such file or directory

Also, it seemed pointless to create symlinks for whole package trees
and using only a part of the result (usually very small part).
2020-08-16 10:23:53 +02:00
Jan Tojnar afe22f645a
Merge branch 'staging-next' into staging 2020-08-13 21:59:15 +02:00
Florian Klink 7361f6f252 nixos/boot: handle systemd-udevd being a symlink to udevadm 2020-08-13 20:51:39 +02:00
Florian Klink 4f7636dafc nixos/systemd: don't try to install systemd-initctl.{service,socket}
These are now only installed by systemd if HAVE_SYSV_COMPAT is true,
which only is the case if you set sysvinit-path and sysvrcnd-path (which
we explicitly unset in the systemd derivation for quite some time)
2020-08-13 20:51:39 +02:00
Florian Klink 2f9d719061 nixos/systemd: remove mymachines nss module from passwd: and group: lines
From the systemd release notes:

nss-mymachines lost support for resolution of users and groups, and now
only does resolution of hostnames. This functionality is now provided by
nss-systemd. Thus, the 'mymachines' entry should be removed from the
'passwd:' and 'group:' lines in /etc/nsswitch.conf (and 'systemd' added
if it is not already there).
2020-08-13 20:51:39 +02:00
Florian Klink e37941e4e4 nixos/systemd: don't try to install systemd-initctl.{service,socket}
Since systemd 246, these are only installed by systemd if
HAVE_SYSV_COMPAT is true, which only is the case if you set
sysvinit-path and sysvrcnd-path (which we explicitly unset in the
systemd derivation for quite some time)
2020-08-13 17:00:24 +02:00
Jörg Thalheim 28224516e5
Merge pull request #92964 from lopsided98/initrd-secrets-compressor 2020-08-13 07:54:01 +01:00
Frederik Rietdijk 7e189c56a1 Merge staging-next into staging 2020-08-13 08:52:48 +02:00
John Ericson 70d68f0478 nixos/systemd: Add support for listenDatagrams
This works exactly analogously to the existing `listenStreams`.
2020-08-11 22:08:19 +00:00
Frederik Rietdijk 46ee7ddcad Merge staging-next into staging 2020-08-11 10:26:59 +02:00
zowoq 8fb410c0ad nixos/*: editorconfig fixes 2020-08-08 10:54:16 +10:00
Frederik Rietdijk cb634b2aa5 Merge staging-next into staging 2020-08-07 23:02:23 +02:00
Jörg Thalheim ba930d8679
nixos/modules: remove trailing whitespace
This leads to ci failure otherwise if the file gets changed.
git-blame can ignore whitespace changes.
2020-08-07 14:45:39 +01:00