Commit graph

229 commits

Author SHA1 Message Date
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
Graham Christensen bd3e9c3d05 nixos/zfs: better support auto-expanding partitioned disks 2022-04-07 13:06:57 -04:00
Luflosi 26a695399a
nixos/apfs: init
Add the final missing pieces for full APFS support.
2022-01-27 15:18:45 +01: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
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
Naïm Favier 2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02: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
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
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
Jens Nolte 22e797947b
nixos/zfs: Add defaultText for 'boot.zfs.package'-option (#122002) 2021-05-13 17:40:10 -04: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
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
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
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
Jörg Thalheim 5b9bfe5625
zfs: fix invalid package references 2021-02-03 11:45:31 +01:00
Jörg Thalheim 0e784a2a3b
nixos/zfs: fix reference to awk
broken in 648a6c4348
2021-02-03 11:43:00 +01:00
Jörg Thalheim 9c6a9d0458
nixos/lxd: refactor to use zfs.package/enabled property 2021-02-01 17:59:18 +01:00
Jörg Thalheim ed1f13244b
nixos/zfs: expose enabled option 2021-02-01 17:59:18 +01:00
Jörg Thalheim 648a6c4348
nixos/zfs: expose zfs package as readonly attribute 2021-02-01 17:59:14 +01: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
Ivan Petkov e2fa74dc68
nixos/zfs: make zpool-trim timer persistent
If the machine is powered off when the zpool-trim timer is supposed to
trigger (usually around midnight) then the timer will be skipped
outright in favor of the next instance.

For desktop systems which are usually powered off at this time, zpool
trimming will never be run which can degrade SSD performance.

By marking the timer as `Persistent = yes` we ensure that it will run at
the first possible opportunity after the trigger date is reached.
2021-01-15 20:23:16 -08: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
davidak d42e2cc24e bcachefs: add sha256 kernel module
needed to mount as root fs
2020-12-25 21:28:50 +01:00
Graham Christensen bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Silvan Mosberger 3307adf755
Merge pull request #98980 from JustinLovinger/idmapd
nixos/nfs: add idmapd.settings option
2020-11-18 22:46:48 +01:00
Sarah Brofeldt e0d51db401 nixos: boot.zfsImportAll = false; by default
Also add 21.03 release note
2020-11-11 18:46:05 +01:00
Sarah Brofeldt a4010e0580 nixos/zfs: Respect forceImportAll in import service 2020-11-11 18:45:14 +01:00
Justin Lovinger 1168e13bb0 nixos/nfs: add idmapd.settings option
Co-authored-by: Aaron Andersen <aaron@fosslib.net>
2020-10-20 22:10:02 -04:00
Vladimír Čunát 538e558f48
Revert "Merge #96844: nixos/nfsd: run rpc-statd as a normal user"
This reverts commit 42eebd7ade, reversing
changes made to b169bfc9e2.

This breaks nfs3.simple test and even current PR #97656 wouldn't fix it.
Therefore let's revert for now to unblock the channels.
2020-09-10 21:31:35 +02:00
Peter Hoeg d6264419f5 nixos/nfsd: run rpc-statd as a normal user 2020-09-07 18:04:03 +08:00
Henri Menke fc4ea9ecba
ZFS: Request credentials only for selected pools
This change introduces more fine-grained requestEncryptionCredentials.
While previously when requestEncryptionCredentials = true, the
credentials for all imported pools and all datasets in these imported
pools were requested, it is now possible to select exactly the pools and
datasets for which credentials should be requested.

It is still possible to set requestEncryptionCredentials = true, which
continues to act as a wildcard for all pools and datasets, so the change
is backwards compatible.
2020-07-21 19:36:10 +12:00
Graham Christensen 9d335706a0
Merge pull request #92092 from ElvishJerricco/zfs-encryption-systemd-ask-password
ZFS: Update description for requestEncryptionCredentials
2020-07-02 17:25:53 -04:00
Will Fancher b5f7b79a2d ZFS: Update description for requestEncryptionCredentials 2020-07-02 16:08:50 -04:00
Graham Christensen 105e63469d
Merge pull request #91344 from ElvishJerricco/zfs-encryption-systemd-ask-password
ZFS: Ask for stage 2 encryption passwords using systemd-ask-password
2020-07-02 14:15:18 -04:00
Will Fancher e2f1594695 ZFS: Set IFS=$'\t' for the read command in stage 2 load-key
Co-authored-by: Graham Christensen <graham@grahamc.com>
2020-07-02 13:50:29 -04:00
Will Fancher 05f8cba1b6 ZFS: Pipe /dev/null into the stage 2 load-key script
Just in case something reads stdin, so that `while read ds kl` doesn't
miss anything
2020-07-02 13:50:28 -04:00
Will Fancher 0d55d48f0f ZFS: Ask for stage 2 encryption passwords using systemd-ask-password 2020-06-23 06:25:21 -04:00
Timo Kaufmann 4843eab3a1
Merge pull request #84135 from symphorien/btrfs-scrub-success
nixos/btrfs autoScrub: don't fail when scrub finishes successfully
2020-06-19 22:55:19 +02:00
datafoo 431106a17e nixos/zfs: add missing dependendy nettools
Fix #87823
2020-05-18 11:25:00 +02:00
Jörg Thalheim 5fb2a9d8c7
Merge pull request #79828 from Mic92/zed
nixos/zfs: populate PATH with needed programs for zed
2020-04-02 13:42:01 +01:00
Symphorien Gibol 55d16d5334 nixos/btrfs autoScrub: don't fail when scrub finishes successfully 2020-04-02 12:00:00 +00:00
Peter Hoeg 8a31cf1459 zfs: document systemd-udev-settle dependency 2020-03-21 11:15:06 +08:00
Léo Gaspard 26b1ef1506
Merge pull request #80141 from symphorien/scrub
nixos/btrfs: make autoScrub not prevent shutdown or suspend
2020-03-12 22:39:34 +01:00
Jörg Thalheim 8f543ed80d
nixos/zfs: continue trimming also if one pool fails
fixes https://github.com/NixOS/nixpkgs/issues/81602
2020-03-03 11:22:07 +00:00
Symphorien Gibol 5359d90b15 nixos/btrfs: make autoScrub not prevent shutdown or suspend
Fixes: #79086 #79017
2020-02-14 12:00:00 +00:00
Jörg Thalheim 92bede3102
nixos/zfs: populate PATH with needed programs for zed 2020-02-11 14:01:22 +00:00
Kai Wohlfahrt b1c10bc8b2 nfs: set up request-key for id mapping
A patch is necessary upstream to support multiple configs via symlinks
in /etc/request-key.d

Once that is done, we can add support for CIFS as well
2019-12-12 15:42:44 +00:00
Silvan Mosberger 4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
nyanloutre c082e13ecb
nixos/zfs: Adding ZED configuration options
Co-authored-by: sjau <github.com@sjau.ch>
2019-12-04 20:29:19 +01:00
Jörg Thalheim faa7ce3ee5
Merge pull request #70240 from woffs/pr-etc-zpool.d
nixos module zfs: provide /etc/zfs/zpool.d
2019-10-15 11:45:52 +01:00
Jörg Thalheim 9a89467606
nixos/zfs: simplify logic for scrub/autosnapshot service
This makes them consistent with the way zfs.trim is enabled
and allow to enable them by default in future.
2019-10-14 10:30:57 +01:00
Jörg Thalheim 692656daf8
nixos/zfs: avoid script derivation for trim service
Since we only have a single pipe we can save the overhead of building a derivation
when creating the zfs trim service file when building the system.
2019-10-08 11:11:06 +01:00
Jörg Thalheim a412d90e10
nixos/zfs: only enable trim if zfs is enabled
Also don't fail the service if there are no pools yet.
This might happen on installation ISOs.
2019-10-07 10:44:56 +01:00
Frank Doepper 3065d00d74 nixos module zfs: provide /etc/zfs/zpool.d
The scripts for zpool iostat -c and zpool status -c are located in
/etc/zfs/zpool.d
2019-10-02 12:34:09 +02:00
Svein Ove Aas e4f975765f
nixos/zfs: Enable trim by default 2019-09-27 18:35:03 +01:00
volth 35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Frederik Rietdijk 7560e2d64f
Merge pull request #65376 from abbradar/mdadm-upstream
Use upstream units for mdadm
2019-08-03 08:06:07 +02:00
Nikolay Amiantov 717b8b3219 systemd service: remove generator-packages option
Use systemd.packages instead, it's less error prone and more in line with
what's expected.
2019-08-01 00:55:35 +03:00
Nikolay Amiantov fd405dab3e systemd service: rename generator-packages 2019-08-01 00:55:35 +03:00
Janne Heß ae608faa85 nixos/xfs: Add xfs_repair to the initrd
Closes #8820
2019-07-30 09:28:34 +02:00
Jörg Thalheim 1d86714a2b
nixos/zfs: add trim service
Introduces a trim timer similar to the fstrim service.
According to zpool(8) for consumer hardware periodic manual TRIM
is preferred over automatic TRIM that ZFS implements.
The period of one week is based on recommendations of fstrim.
2019-07-25 12:47:43 +01:00
Ivan Jager a38449f159 nixos/zfs: enable requestEncryptionCredentials by default
Since zfsStable now supports encryption, it no longer makes sense to set
the default based on whether we're using zfsUnstable
2019-07-04 16:11:52 -05:00
Silvan Mosberger 852fe410fc
nixos/zfs: Remove requestEncryptionCredentials assertion
zfs >= 0.8 supporting encryption is now stable
2019-06-21 03:33:09 +02:00
Jörg Thalheim 11b8a5f20e
zfs: 0.7.13 -> 0.8.0
Same as zfsUnstable for the moment.
We still keep the zfsUnstable expression as we likely
need it in the near future again.
Also remove spl since it is no longer needed.
2019-06-06 10:07:43 +01:00
Aaron Andersen 4a11ce7f26
cleanup redundant text in modules utilizing mkEnableOption
Closes #59911
2019-04-20 14:44:02 +02:00
Symphorien Gibol a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
Jörg Thalheim 859ce47b02
Merge pull request #53965 from mayflower/zfs-autoscrub-fix
nixos/zfs: autoscrub only after boot is complete
2019-01-22 10:48:17 +00:00
Jörg Thalheim a6b97bd1bb
Merge pull request #42183 from kisik21/master
nixos/stage-1, nixos/f2fs: added F2FS resizing
2019-01-17 07:42:32 +00:00
Linus Heckemann 783f2c84e8 nixos/zfs: autoscrub only after boot is complete
Fixes #53583
2019-01-14 21:00:20 +01:00
hyperfekt 95b2b6f541 nixos/bcachefs: enable encrypted root
Enables automatic decryption for bcachefs-formatted filesystems needed during boot.
2018-11-06 09:26:35 +01:00
hyperfekt 482228919c nixos/bcachefs: remove superfluous fsck from initrd
bcachefs checks the filesystem at mount time, therefore no separate fsck binary is needed in initrd.
2018-11-03 18:07:32 +01:00
Andrew Dunham c3e004799c Hide useless errors when waiting for zpool to be ready 2018-10-16 02:45:25 -07:00
Jörg Thalheim 4360a87c45 linuxPackages.zfsUnstable: 2018-05-22 -> 2018-08-13
spl was merged into zfs master
2018-08-14 14:12:07 +02:00
Jörg Thalheim 43595c7884 zfsLegacyCrypto: remove
This package was only mandatory for migration for people on zfsUnstable
in nixos unstable.
2018-08-13 19:53:50 +02:00
volth 2e979e8ceb [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
volth 87f5930c3f [bot]: remove unreferenced code 2018-07-20 18:48:37 +00:00
Svein Ove Aas cfd8c4ee88 zfs: Improve import handling 2018-07-02 21:14:45 +01:00
Frank Doepper c5da007af5 nixos/zfs: load encryption keys for all pools (#41846)
fixes #41838

At the moment it works fine for "file://" keys, but does not work for
dataPools with "prompt" keys, because the passphrase cannot be entered
(yet).
2018-06-28 11:04:30 +01:00
Victor Shlein 62d21f2511 nixos/f2fs: fixed autoresize check 2018-06-19 14:31:06 +03:00
Victor Shlein 4fa88fcecb nixos/stage-1, nixos/f2fs: moved f2fs resizing tools include in f2fs module 2018-06-19 14:27:36 +03:00
Frank Doepper 673ecfcbaa nixos/zfs: mount AFTER import 2018-06-15 20:58:43 +02:00
Frank Doepper bea4323acf nixos/zfs: enable zfs services 2018-06-13 16:31:05 +02:00
Svein Ove Aas deb6c6e052 zfs: Fix "zfs-sync" for modern systemd 2018-06-09 01:17:04 +01:00
Jörg Thalheim 7663de114a lxd: 2.16 -> 3.0.0 2018-04-14 11:02:24 +01:00
volth 49ed1229b6
exfat-utils, fuse_exfat -> exfat
`exfat-utils' and `fuse_exfat' are both aliases of `exfat'
2018-04-12 11:23:52 +00:00
Benjamin Andresen 96f10e7e49 zfs.autoSnapshot: make frequent run every 15 mins
fixes bug that there is 30 minutes between hh:45 and hh:15 every hour.
2018-04-11 16:45:00 +02:00
Jörg Thalheim b6bcba6537 nixos/zfs: fix typo in enableLegacyCrypto description 2018-02-08 10:24:47 +00:00
sjau 0d65e2e0e5 zfs: add migration path for new crypto format
fixes #34559
2018-02-07 20:46:16 +00:00
Graham Christensen 9f31fe81aa
nixos: zfs: correct the networking.hostId error message
Users were confused that the error message said config.networking.hostId, and indeed that did nothing to fix their problem.

Update the error message to specify the option they should actually set.
2017-12-20 17:56:03 -05:00
Florian Jacob fc21593352 nixos/btrfs: add services.btrfs.autoScrub
for automatic regular scrubbing of mounted btrfs filesystems,
similar to what's already there for zfs.
2017-12-13 11:00:28 +01:00
edef ea35bc94bf nixos/ecryptfs: init
Currently, ecryptfs support is coupled to `security.pam.enableEcryptfs`, but one
might want to use ecryptfs without enabling the PAM functionality. This commit
splits it out into a `boot.supportedFilesystems` switch.
2017-10-20 17:42:04 +01:00
Tuomas Tynkkynen e86b78363d nixos/filesystems/ext: Don't try to load ext3 module
This module doesn't exist since v4.3, where the ext3 driver was removed
as ext4.ko can mount ext3 filesystems as well.
2017-10-07 11:01:01 +03:00
Jörg Thalheim 9164517c18 nixos/zfs: import encrypted datasets by default for zfsUnstable 2017-09-26 09:08:53 +01:00
Ruben Maher 98a2316166 nfs-utils: set /etc/krb5.keytab as default path for rpc-gssd
Currently the `rpc-gssd.service` has a `ConditionPathExists` clause that can
never be met, because it's looking for stateful data inside `/nix/store`.

`auth-rpcgss-module.service` also only starts if this file exists.

Fixes NixOS/nixpkgs#29509.
2017-09-20 15:36:26 +01:00
Jörg Thalheim 1ecf3e862f zfsUnstable: init at 2017-09-12 2017-09-15 17:59:37 +02:00