Commit Graph

1751 Commits

Author SHA1 Message Date
Alyssa Ross
5c8ddfd0b5 nixos/stage-1: update udev.log_level name in docs
I was confused why I couldn't find a mention of udev.log_priority in
systemd-udevd.service(8).  It turns out that it was renamed[1] to
udev.log_level.  The old name is still accepted, but it'll avoid
further confusion if we use the new name in our documentation.

[1]: 64a3494c3d
2022-01-12 14:04:14 +00:00
Madoura
f363642de7
nixos/stage-1: colon-separated multi-device support 2022-01-09 18:06:03 -06:00
github-actions[bot]
cf7efe1192
Merge staging-next into staging 2022-01-08 12:01:36 +00:00
Maciej Krüger
801d832872
Merge pull request #125451 from zhaofengli/qemu-riscv64-sd-image 2022-01-07 22:14:05 +01:00
Zhaofeng Li
16a907b00b generic-extlinux-compatible: Allow disabling generation of device tree directives 2022-01-06 17:23:10 -08:00
github-actions[bot]
1342506d40
Merge staging-next into staging 2022-01-07 00:04:19 +00:00
0x4A6F
29acc14f0d
Merge pull request #143060 from zhaofengli/binfmt-argv0
nixos/binfmt: Add QEMU wrapper to preserve argv[0]
2022-01-06 19:21:47 +01:00
github-actions[bot]
a738715d80
Merge staging-next into staging 2022-01-05 00:02:28 +00:00
pennae
fc614c37c6 nixos/documentation: split options doc build
most modules can be evaluated for their documentation in a very
restricted environment that doesn't include all of nixpkgs. this
evaluation can then be cached and reused for subsequent builds, merging
only documentation that has changed into the cached set. since nixos
ships with a large number of modules of which only a few are used in any
given config this can save evaluation a huge percentage of nixos
options available in any given config.

in tests of this caching, despite having to copy most of nixos/, saves
about 80% of the time needed to build the system manual, or about two
second on the machine used for testing. build time for a full system
config shrank from 9.4s to 7.4s, while turning documentation off
entirely shortened the build to 7.1s.
2022-01-02 19:46:13 +01:00
Naïm Favier
f2065d81ad stdenv/generic: introduce shellDryRun
Add `shellDryRun` to the generic stdenv and substitute it for uses of
`${stdenv.shell} -n`. The point of this layer of abstraction is to add
the flag `-O extglob`, which resolves #126344 in a more direct way.
2021-12-27 20:30:01 -05:00
Artturi
3239e947d1
Merge pull request #151156 from Artturin/fsckonbat 2021-12-27 04:18:40 +02:00
Michael Hoang
13903fef2d nixos/systemd-boot: Add option to add netboot.xyz 2021-12-23 11:44:29 +11:00
Michael Hoang
f6b61981b1 nixos/systemd-boot: Support extra EFI entries 2021-12-23 11:44:29 +11:00
Florian Klink
60e571fa40
Merge pull request #150922 from ncfavier/systemd-tzdir
nixos/systemd: set TZDIR for PID 1
2021-12-22 11:52:27 +01:00
Artturin
c44f95a855 nixos/stage1: run fsck on battery too
We are in 2021 almost 2022 not in 2004 when this may have been an issue!

https://alioth-lists.debian.net/pipermail/pkg-sysvinit-devel/2009-May/003196.html
https://www.nico.schottelius.org/blog/debian-ubuntu-fsck-skip-on-battery-bug/
d29daf3952
https://bugs.launchpad.net/ubuntu/+source/laptop-mode/+bug/11194
2021-12-18 06:06:10 +02:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
Robert Hensing
4014fb6a64 nixos: Make system.build a lazyAttrsOf unspecified
Legacy types.attrs has really bad merging behavior and does not
support priorities.

f build
2021-12-17 14:42:44 +01:00
Naïm Favier
901d4f13a3
nixos/systemd: set TZDIR for PID 1
Fixes #105049
2021-12-16 04:09:07 +01:00
Bernardo Meurer
f40283cf62
Merge pull request #149837 from helsinki-systems/feat/redo-activation-script-restarting
nixos/switch-to-configuration: Add a massive test and do a slight refactor
2021-12-13 11:37:20 -08:00
Janne Heß
6807628791
nixos/switch-to-configuraton: Add details about sockets 2021-12-09 13:51:18 +01:00
Andreas Rammhold
6e69e537ff
Merge pull request #145183 from veehaitch/networkd-DHCPServerStaticLease
nixos/networkd: add `dhcpServerStaticLeaseConfig` option
2021-12-09 12:57:46 +01:00
Janne Heß
2024306048
nixos/switch-to-configuration: Restart non-services 2021-12-09 12:31:48 +01:00
Janne Heß
393c721849
nixos/switch-to-configuration: Move handleModifiedUnit into a sub 2021-12-09 11:31:59 +01:00
pennae
2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00
Florian Klink
fec4daf38d
Merge pull request #149342 from helsinki-systems/feat/restart-systemd-on-systemconf-change
nixos/switch-to-configuration: Restart systemd when system.conf is changed
2021-12-08 23:23:04 +01:00
ajs124
eee45bb295
Merge pull request #146815 from ElvishJerricco/systemd-utils-expressions
Move systemd-lib.nix and systemd-unit-options.nix into utils
2021-12-08 15:07:28 +00:00
Janne Heß
e36ceb65e6
Merge pull request #129449 from ddz/copy-initrd-secrets-after-early-mount-script
nixos/stage1: copy initrd secrets into place after special mounts
2021-12-08 15:38:02 +01:00
Janne Heß
1f41365cda
nixos/switch-to-configuration: Restart systemd when system.conf is changed 2021-12-07 14:32:19 +01:00
Bernardo Meurer
ebb7f07eec
Merge pull request #148751 from NixOS/feat/slight-stc-improvements
nixos/switch-to-configuration: Add small improvements
2021-12-07 02:38:26 -08:00
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