Commit graph

722 commits

Author SHA1 Message Date
Klemens Nanni d1754b1ab0 nixos/filesystems/zfs: Use proper script mode
Tell zpool-list(8) to format output rather than modifying it afterwards.

Furthermore, pool names may contain spaces and would thus break due to
awk(1)'s word splitting.
2022-05-03 16:28:39 +02:00
Klemens Nanni 2a341bd2f4 nixos/filesystems/zfs: Escape dataset names
Although unlikely, ZFS happily accepts names like 'zroot/foo -r'.

Escape names and separate command line options from arguments to avoid
any kind of misinterpretation.
2022-05-03 15:56:54 +02:00
Maximilian Bosch 196c877c85
nixos/network-interfaces: remove outdated deprecation information 2022-04-30 12:40:10 +02:00
Maximilian Bosch aa849e1478
nixos/network-interfaces-systemd: actually set catchall-iface if useDHCP = true;
Previously this wasn't done in the `forEach`-expression for
`cfg.interfaces` and thus `networking.useDHCP` didn't have any effect if
no further interface was statically configured.
2022-04-30 00:30:03 +02:00
Linus Heckemann d30dbf38b9
nixos/networkd: reimplement useDHCP in a sensible way 2022-04-30 00:30:01 +02:00
Will Fancher 2e96b64e02
Merge pull request #170123 from ElvishJerricco/systemd-shutdown-ramfs-fixup
Systemd shutdown ramfs fixup
2022-04-28 20:17:23 -04:00
Will Fancher 50925651bb zfs: Sync pools on shutdown. 2022-04-28 14:12:16 -04:00
Janne Heß 69d1acda00
nixos/xfs: Fix evaluation (#170471) 2022-04-26 21:43:01 +02:00
Janne Heß acca69992c
nixos/btrfs: Add systemd stage 1 support 2022-04-24 16:32:54 +02:00
Janne Heß 160fb93fdc
nixos/filesystems: Make most simple filesystems compatible with systemd
This includes disabling some features in the initrd by default, this is
only done when the new initrd is used. Namely, ext and bcache are
disabled by default. bcache gets an own enable option while ext is
detected like any other filesystem.
2022-04-24 16:32:34 +02:00
Janne Heß a719f5fb9d
Merge pull request #168965 from helsinki-systems/feat/systemd-stage-1-hostid
nixos/stage-1-init: Set host id for ZFS
2022-04-18 18:31:18 +02:00
Thiago Kenji Okada 99b20f5580
Merge pull request #107957 from tex/nixos/auto-upgrade
nixos/auto-upgrade: add persistent option
2022-04-16 23:06:17 +01:00
Janne Heß 3396c96e4b
nixos/stage-1-init: Set host id for ZFS 2022-04-16 21:32:18 +01:00
Milan Svoboda a5fb565bf5 nixos/auto-upgrade: add persistent option 2022-04-16 19:27:21 +02:00
Janne Heß 01bc138a8e
nixos/stage-1-init: Merge mdraid module into swraid 2022-04-15 19:57:16 +01:00
Janne Heß 2633e82e1a
nixos/stage-1-systemd: Add LVM2 support 2022-04-13 23:00:19 +01:00
Graham Christensen bd3e9c3d05 nixos/zfs: better support auto-expanding partitioned disks 2022-04-07 13:06:57 -04:00
ajs124 6a8face381 nixos/tests/lvm2: don't try to add script from vdo to initrd 2022-04-04 14:23:09 +01:00
ajs124 397f065cb4 nixos/tasks/lvm: add vdo support 2022-04-04 13:00:46 +01: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
Jade e50bc2f36d
nixos/nix-gc, nixos/auto-upgrade: Minor documentation fixes.
The gc documentation had some artifacts (presumably being copied from
autoupgrade) and the autoupgrade docs had a typo
2022-03-31 00:24:25 -04:00
Linus Heckemann 3631db714c
Merge pull request #158176 from lheckemann/fix-tempaddr
network-interfaces: use altered interface name for setting use_tempaddr
2022-03-29 10:39:46 +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
Will Fancher 213de9b108 systemd-initrd: autoFormat and autoResize in initrd 2022-03-22 21:28:51 -04:00
jpathy 19bb72c070 networking.greTunnels: Add ttl option 2022-03-23 00:24:44 +05:30
pennae e8bfc4d4a8
Merge pull request #164367 from jpathy/patch-2
networking.greTunnels: support ip6gre*
2022-03-18 15:43:03 +00:00
Silvan Mosberger 839b9b8ddc
Merge pull request #77622 from R-VdP/nixos-upgrade-reboot-window
NixOS/auto-upgrade: offer the possibility to define a reboot window during which the system may be automatically rebooted
2022-03-17 23:50:53 +01:00
jpathy 0a62de4cd5 networking.greTunnels: support ip6gre* 2022-03-17 17:59:36 +05:30
R-VdP 39f3eb3004 NixOS/auto-upgrade: offer the possibility to define a reboot window during which the system may be automatically rebooted
Some systems should not be rebooted at just any time. If the upgrade process takes too long, for instance because of a
slow internet connection, or if the upgrade service is ran during production hours, we want to allow to define a window
outside of which a reboot will not be performed.
The system will then reboot on the next run of the upgrade service which finishes inside the reboot window.

E.g. we can run the update service twice per week, once during the night and once during the day, but reboots are only
allowed during the night. By doing so, a system that is usually shut down during the night will still receive updates
and systems that are turned on 24/7 can be rebooted outside of production hours.

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2022-03-09 08:18:16 +01:00
Alyssa Ross 1176525f87 treewide: remove obsolete kernel version checks
We don't support Linux kernels older than 4.4 in Nixpkgs.
2022-02-19 21:09:19 +00:00
Linus Heckemann c74d784771 network-interfaces: use altered interface name for setting use_tempaddr
Fixes #86764
2022-02-05 00:13:03 +01:00
Jade fe636b4805
nixos/networking: Typo fix 2022-02-04 13:55:56 -05:00
Luflosi 26a695399a
nixos/apfs: init
Add the final missing pieces for full APFS support.
2022-01-27 15:18:45 +01:00
Luflosi 64560de406
nixos/networkd: fix networking.networkd.static test
Commit ca58bd0a50 broke the test networking.networkd.static. This happened because the test sets `networking.defaultGateway`. This is implemented by adding the gateway to the list of `routes` using `mkDefault`. The `routes` are then overridden by an empty list in the newly added code. Replace `mkDefault` with `id` so the two lists are merged and everything (hopefully) works as expected.
See https://github.com/NixOS/nixpkgs/pull/144590 for a more context.
2022-01-21 19:35:17 +01:00
Luflosi ca58bd0a50
nixos/networkd: Add routes from interfaces to [Route] section of .network file
Closes https://github.com/NixOS/nixpkgs/pull/93635.
2022-01-20 20:14:55 +01:00
Guillaume Girol fdc3784828
Merge pull request #148637 from hexagonal-sun/network/gre-tap-tun
nixos/network: add gre virtual interfaces
2022-01-01 17:04:29 +00: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
pennae 9407761763 treewide: add defaultText for options using other shortcut bindings 2021-12-09 01:42:24 +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
pennae ed673a69db treewide: add defaultText for options with simple cfg.* expression defaults
adds defaultText for options with defaults that use only literals, full config.*
paths, and the cfg shortcut binding.
2021-12-09 01:14:16 +01:00
David Knaack 28db2a481d
nixos/snapraid: fix evaluation
Use string concatenation operator (`+`) instead of incorrect list concatenation operator (`++`)
2021-12-08 11:10:02 +01:00
Matthew Leach 5ce7061945 nixos/networking: add options for configuring a GRE tunnel
Add `networking.greTunnels` option that allows a GRE tunnel to be
configured in NixOS.
2021-12-07 15:44:00 +00:00
lunik1 6073b099d0
nixos/snapraid: relax permissions of snapraid-sync
Remove PrivateDevices to silence warning about SnapRAID being
unable to access disk UUIDs.

Add CAP_FOWNER when touch is enabled so file time stamps can be
set.
2021-12-03 15:55:27 +00:00
Artturi a0d4895e9d
Merge pull request #146709 from Artturin/underscorename 2021-11-21 03:12:31 +02:00
Artturin 2077956e78 nixos/network-interfaces: add a warning for underscores in hostname
until the issues in https://github.com/NixOS/nixpkgs/pull/138978
have been resolved
2021-11-21 01:39:39 +02:00
Artturi 1c005b3de1
Merge pull request #139337 from Artturin/tempaddr 2021-11-20 01:27:13 +02:00
Cheng Shao 4cd015e65e NixOS auto upgrade: add openssh to path 2021-11-19 12:52:36 +00:00
Artturin 31759dc4b7 nixos/networkmanager: remove redundant ipv6.ip6-privacy
this setting was added in 2016 in commit
bcdd81d9e1

the posibility to preferTempAddress was added to
nixos/network-interface in 2018 in commit
1fec496f38

preferTempAddress was renamed to tempAddress
in 2020 in commit 2485e6399e

therefore this setting is redundant since nm will use the sysctl option

nixos/network-interfaces: add default to sysctl so that the value for it
is set

networkmanager falls back to it
https://man.archlinux.org/man/NetworkManager.conf.5
2021-11-19 01:12:25 +02:00
Cole Helbling 516b49155e nixos/zfs: replace parentheses with braces
The parentheses prevent the `continue` line from working by running the
enclosed in a subshell -- I noticed that ZFS would start asking me for
my password to encrypted child datasets, even though they were not
specified in `requestEncryptionCredentials`. The following logs would
also be present in the import unit's journal:

    Oct 31 22:13:17 host systemd[1]: Starting Import ZFS pool "pool"...
    Oct 31 22:13:44 host zfs-import-pool-start[3711]: importing ZFS pool "pool"...
    Oct 31 22:13:44 host zfs-import-pool-start[4017]:pool/nix/store/39zij3xcxn4w38v6x8f88bx8y91nv0rm-unit-script-zfs-import-pool-start/bin/zfs-import-pool-start: line 31: continue: only meaningful in a `for', `while', or `until' loop
    Oct 31 22:13:44 host zfs-import-pool-start[4020]:pool/nix/store/39zij3xcxn4w38v6x8f88bx8y91nv0rm-unit-script-zfs-import-pool-start/bin/zfs-import-pool-start: line 31: continue: only meaningful in a `for', `while', or `until' loop
    Oct 31 22:15:14 host zfs-import-pool-start[4023]: Failed to query password: Timer expired
    Oct 31 22:15:14 host zfs-import-pool-start[4024]: Key load error: encryption failure
    Oct 31 22:15:14 host systemd[1]: zfs-import-pool.service: Main process exited, code=exited, status=255/EXCEPTION
    Oct 31 22:15:14 host systemd[1]: zfs-import-pool.service: Failed with result 'exit-code'.
    Oct 31 22:15:14 host systemd[1]: Failed to start Import ZFS pool "pool".
2021-11-03 04:59:46 -04:00
pennae c1f5155471 nixos/networking: support FOU encapsulation for sits 2021-10-16 20:48:03 -04: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
Michele Guerini Rocco 46b2a2594a
Merge pull request #140779 from legendofmiracles/wol
nixos/wakeonlan: switch to systemd.link and to nixos/networking
2021-10-09 10:34:26 +02:00
legendofmiracles bb3ea37eee
nixos/networking: add the wakeonlan option 2021-10-07 14:15:17 -06:00
Naïm Favier 2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Samuel Dionne-Riel 110165b784 Provide submodule to security.wrappers for older kernels
Fixes a regression from #126289
2021-09-29 16:10:27 -04:00
rnhmjoj fedd7cd690
nixos: explicitely set security.wrappers ownership
This is slightly more verbose and inconvenient, but it forces you
to think about what the wrapper ownership and permissions will be.
2021-09-13 13:48:13 +02:00
Lassulus 7cd6b6dfc8
Merge pull request #132786 from helsinki-systems/feat/initrd-dm-cache
tasks/lvm: add all tools from thin-provisioning-tools
2021-09-08 18:19:41 +02:00
Michele Guerini Rocco 052009bf2b
Merge pull request #135315 from johnjameswhitman/johnjameswhitman/fix-wlan-sub-interfaces
nixos/tasks/network-interfaces: Assign mac to new wlan interface instead of underlying one
2021-09-02 09:37:04 +02:00
John Whitman 8d3527aa88 nixos/network-interfaces: Fix wlan interface mac 2021-09-01 21:46:26 -04:00
davidak a023b22d6b
Merge pull request #105786 from teto/fstab
filesystems: add syntax to /etc/fstab header
2021-08-26 05:53:25 +02:00
Sandro 49b5beea43
Merge pull request #128624 from vs49688/exfat 2021-08-25 12:24:39 +02:00
Your Name 4bb4bcc30c services.zfs.expandOnBoot: support expanding pools on boot
Either enumerating a list of pools to expand or expanding
all pools on boot.
2021-08-24 15:01:08 -04:00
Zane van Iperen a049d84229
nixos/filesystems/exfat: use "exfatprogs" instead of "exfat" if kernel > 5.7
5.7+ comes with a native exfat implementation, exfatprogs should be used instead.

The exfat package puts a "mount.exfat" binary in the path, which causes
mount to prefer the FUSE version to the non-fuse one. There's no way to
disable the binary, so switch to exfatprogs.
2021-08-24 03:31:41 +10:00
ajs124 f358f7326b tasks/lvm: add all tools from thin-provisioning-tools
This should barely increase the size of the initrd, because these are all symlinks.
With this, systems with dm-cache/lvmcache can also be booted, although the kernel modules for the relevant dm targets still need to be added to the initrd with boot.initrd.kernelModules.
2021-08-20 12:55:06 +02:00
Michele Guerini Rocco a336bdd209
Merge pull request #103738 from netixx/openvswitch-improved-systemd
openvswitch: fix systemd integration assertion
2021-08-16 11:48:53 +02:00
ajs124 ce080720fb
Merge pull request #131587 from hyperfekt/systemd-pstore
nixos/filesystems: succeed mount-pstore.service without backend
2021-07-27 14:27:15 +02:00
Ben Siraphob b63a54f81c
Merge pull request #110742 from siraben/deprecate-fold 2021-07-27 15:13:31 +07:00
hyperfekt b3200bc922 nixos/filesystems: succeed mount-pstore.service without backend 2021-07-26 21:02:58 +00:00
Luke Granger-Brown a0b7bd69ac
Merge pull request #124431 from hyperfekt/systemd-pstore
nixos/filesystems: mount-pstore.service improvements
2021-07-25 10:33:39 +01:00
Robert Hensing 98352288bd
Merge pull request #128032 from Artturin/add-swap-options
nixos/swap: add options option
2021-07-23 10:45:53 +02:00
Artturin c971de97c4 nixos/swap: add options option 2021-07-20 20:51:27 +03:00
lunik1 145a3d084a
nixos/snapraid: init 2021-07-14 19:02:19 +01:00
Atemu f879395bd9
nixos/btrfs: handle new checksum types in initrd (#126158)
Can't mount a root formatted with those otherwise
2021-07-06 09:57:10 -04:00
Niklas Hambüchen 685e8ff7dd xserver: Generate readable config indentation 2021-06-17 03:34:40 +02:00
Sandro 2b49e4e735
Merge pull request #107728 from nessdoor/master 2021-06-15 14:40:21 +02:00
jakobrs b07602a604 nixos/lib, nixos/filesystems: Make fsBefore more stable, and add depends option 2021-06-08 18:51:31 +02:00
hyperfekt af871f619c nixos/filesystems: await builtin pstore module backend in mount-pstore
If the pstore module is builtin, it nonetheless can take considerable
time to register a backend despite /sys/fs/pstore already appearing
mounted, so the condition is moved into the main script to extend
waiting for the backend to this case.
2021-05-30 03:43:56 +02:00
hyperfekt 92cbe52e19 nixos/filesystems: condition mount-pstore.service on pstore module
systemd's modprobe@.service does not require success so mount-pstore
executed despite a non-present pstore module, leading to an error about
the /sys/fs/pstore mountpoint not existing on CONFIG_PSTORE=n systems.
2021-05-30 03:43:50 +02:00
hyperfekt ef991f9b8b nixos/filesystems: condition mount-pstore.service on unmounted /sys/fs/pstore
For unknown reasons, switching to a system that first introduces this
service has it fail with /sys/fs/pstore already having been mounted.
2021-05-21 17:49:23 +02:00
Tomas Antonio Lopez b922fa959b nixos/swap: add discardPolicy option
Add option for activating discards on swap partitions (none, once, pages and both).
2021-05-19 21:23:35 +09:00
ajs124 8e78793029 nixos/tasks/filesystems: utillinux -> util-linux 2021-05-17 14:47:57 +02:00
Florian Klink 6c0058f47f
Merge pull request #85073 from hyperfekt/systemd-pstore
nixos/systemd|filesystems: mount and evacuate /sys/fs/pstore using systemd-pstore
2021-05-17 00:00:52 +02:00
github-actions[bot] bf5d8bb531
Merge master into staging-next 2021-05-14 00:58:11 +00:00
Jens Nolte 22e797947b
nixos/zfs: Add defaultText for 'boot.zfs.package'-option (#122002) 2021-05-13 17:40:10 -04:00
hyperfekt 870fa77ff6 nixos/filesystems: mount persistent storage to /sys/fs/pstore 2021-05-09 23:21:32 +02:00
github-actions[bot] 1ae6d3d02f
Merge master into staging-next 2021-05-07 18:24:29 +00:00
Linus Heckemann 4c4ac4bb20 nixos/network: allow configuring tempaddr for undeclared interfaces 2021-04-27 16:43:30 +02:00
Julien Moutinho 05d334cfe2 Revert "Revert "apparmor: fix and improve the service""
This reverts commit 420f89ceb2.
2021-04-23 07:17:55 +02:00
Luflosi e205a4800f
nixos/cpu-freq: fix typo in description
This typo was introduced when the option was first added in 2011, almost 10 years ago (ae82e7b048).
2021-04-21 22:03:18 +02:00
Jörg Thalheim fc02b14738
Merge pull request #117071 from mohe2015/hotfix-zfs-grub
nixos/zfs: Fix regression that prevents people to boot from zfs using grub if they didn't add zfs to boot.initrd.supportedFilesystems
2021-04-17 16:01:22 +01:00
ajs124 c6d4dae35d treewide: fix eval without aliases after 9378fdf87e 2021-04-08 13:33:09 +02:00
Sandro Jäckel 9378fdf87e
iproute: deprecate alias 2021-04-04 01:43:46 +02:00
Alyssa Ross b0854238b0 nixos/zfs: fix autoScrub.enable description
This was previously "Whether to enable Enables periodic scrubbing of
ZFS pools.."
2021-04-01 19:19:00 +00:00
oxalica 80a1336bb9 nixos/filesystems: always write mount options for swap devices
According to fstab(5), unlike last two fields `fs_freq` and `fs_passno`,
the 4-th field `fs_mntops` is NOT optional, though it works when omitted.

For best-practice and easier to be parsed by other programs, we should always
write `defaults` as default mount options for swap devices.
2021-03-28 19:54:03 +02:00
Hedtke, Moritz 742f3a4369
nixos/zfs: Fix regression that prevents people to boot from zfs using grub if they didn't add zfs to boot.initrd.supportedFilesystems
See https://github.com/NixOS/nixpkgs/pull/99386
2021-03-20 23:57:50 +01:00
Florian Klink 53a0c2878b
Merge pull request #111786 from flokli/systemd-247.3
systemd: 247.2 -> 247.3
2021-02-12 12:52:49 +01:00
Cole Helbling 1ed5b6a285
zfs: disable smartmontools mail functionality 2021-02-06 22:04:00 -08:00
Cole Helbling 370df31f1c
nixos/zfs: make zed mail optional
"zed does not need the ability to send email by default" --Eelco
2021-02-06 22:03:59 -08:00
Florian Klink 24bebfa308 Revert "nixos/network-interfaces-systemd: fix IPv6 privacy extensions"
This reverts commit d349582c07.

The workaround initially applied isn't necessary anymore, as 247.3
contains the following commit:

> 242fc1d261 network: fix IPv6PrivacyExtensions=kernel handling

… which fixes https://github.com/systemd/systemd/issues/18003.
2021-02-03 22:21:19 +01:00
Jörg Thalheim 5b9bfe5625
zfs: fix invalid package references 2021-02-03 11:45:31 +01:00