Commit graph

1873 commits

Author SHA1 Message Date
Janne Heß 1bea49d3bf
nixos/stage-1-systemd: Add LUKS w/ password support 2022-04-18 11:42:45 +01:00
Florian Klink 52e346d6dd
Merge pull request #168774 from helsinki-systems/feat/systemd-shutdown
nixos/systemd: Properly shut down the system
2022-04-18 09:52:07 +02:00
Will Fancher 9e8b463cce nixos: Handle panic_on_fail in systemd stage 1 2022-04-17 18:31:35 -04:00
Sandro b4e7303ddf
nixos/specialisation: fix curly brackets 2022-04-17 05:48:33 +02:00
Janne Heß 30a00c29c4
nixos/systemd: Properly shut down the system 2022-04-16 21:17:36 +01:00
Janne Heß 031b95e587
Merge pull request #168814 from helsinki-systems/feat/systemd-stage-1-pass-vars
nixos/systemd-stage-1: Pass more vars to the builder
2022-04-16 22:02:26 +02:00
Janne Heß b9bf28fd70
nixos/stage-1-init: Pass all parameters to the builder
This is for compatiblity with the old builder to get compat with uboot
support and to prepend microcode updates to the initrd
2022-04-16 20:36:18 +01:00
Janne Heß 01bc138a8e
nixos/stage-1-init: Merge mdraid module into swraid 2022-04-15 19:57:16 +01:00
Thomas Watson 7fd6cea253 make-initrd: fix reproducibility problems
cpio includes the number of directory hard links in archives it creates.
Some filesystems, like btrfs, do not count directory hard links the same
way as more common filesystems like ext4 or tmpfs, so archives built
when /tmp is on such a filesystem do not reproduce. This patch replaces
cpio with bsdtar, which does not have this issue. The specific
invocation is from this page:
https://reproducible-builds.org/docs/archives/
2022-04-14 19:06:30 -05:00
Lassulus 15b5c29a41
Merge pull request #168600 from helsinki-systems/feat/systemd-stage-1-keymap
nixos/stage-1-systemd: Add keymap support
2022-04-14 21:50:52 +01:00
Janne Heß 289f38a65b
Merge pull request #168301 from helsinki-systems/feat/systemd-stage-1-mdadm
nixos/stage-1-systemd: Add mdraid support (+ test)
2022-04-14 17:56:36 +02:00
Janne Heß dda7e9e3ee
nixos/stage-1-systemd: Add mdraid support (+ test) 2022-04-14 11:39:57 +01:00
Janne Heß 0581d31bf9
Merge pull request #167393 from iblech/patch-docs-cc
nixos-rebuild, switch-to-configuration: document and protect against cross compilation subtlety
2022-04-14 12:30:39 +02:00
Janne Heß 6d6c1c341c
nixos/stage-1-systemd: Add keymap support
Makes my life a lot easier with my non-american keyboard layout
2022-04-14 10:25:04 +01:00
Janne Heß aeb75b3b69
nixos/stage-1-systemd: Implement hibernation + test 2022-04-13 23:02:13 +01:00
Janne Heß ffb320378b
nixos/stage-1-systemd: Fix booting grub tests 2022-04-13 23:02:10 +01:00
Lassulus 65cc198539
Merge pull request #167349 from helsinki-systems/feat/udev-systemd-stage-1
nixos/udev: Add systemd stage 1 support
2022-04-12 21:02:52 +01:00
Lassulus c0139fe5c3
Merge pull request #167168 from helsinki-systems/feat/systemd-stage-1-proper-handover
nixos/stage-1-systemd: Handover between the systemds directly
2022-04-11 22:26:11 +01:00
Janne Heß 3df2691e6b
nixos/stage-1-systemd: Handover between the systemds directly 2022-04-11 20:04:33 +01:00
Janne Heß fb44ecd129
nixos/udev: Add systemd stage 1 support 2022-04-11 19:43:26 +01:00
Erik Arvstedt 63528cb1a6
nixos/systemd: remove duplicate definition of systemd.user.timers
It's already defined in `systemd/user.nix`.
This is a leftover from commit b6d50528dd
where all `systemd.user` settings were moved to `systemd/user.nix`.
2022-04-11 13:01:40 +02:00
Janne Heß adab6ce552
nixos/systemd-stage-1: Minor fixups
- Fix the name of the env
- Add the correct kmod to the initrd
- Add `less` to make journalctl usable
- Fix SYSTEMD_SULOGIN_FORCe for rescue.target
- Add some missing binaries
2022-04-11 11:13:01 +01:00
Luke Granger-Brown 4ea239aa70
Merge pull request #163958 from lukegb/networkd-main
nixos/networkd: configure /etc/systemd/networkd.conf
2022-04-11 02:01:19 +01:00
Luke Granger-Brown f47caf769b nixos/networkd: configure /etc/systemd/networkd.conf
The networkd.conf file controls a variety of interesting settings
which don't seem to be configurable at the moment, including
adding names to route tables (for networkd only, although this commit
also exports them into iproute2 for convenience's sake), and
the speed metering functionality built into networkd.

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

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

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

I started by making the following global replacements:

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

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

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

Then I manually investigated and fixed the following packages:

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

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

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

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

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

usbfs is deprecated and unused.

hwclock seems to be automatically executed by systemd on startup.

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

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

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