nixpkgs/nixos/modules
Klemens Nanni 9553106832 nixos/stage-1: Ensure correct ZFS mount options
Consider ZFS filesystems meant to be mounted with zfs.mount(8), e.g.
```
config.fileSystems."/media".options = [ "zfsutil" ];
config.fileSystems."/nix".options = [ "zfsutil" ];
```

`zfsutil` uses dataset properties as mount options such that zfsprops(7)
do not have to be duplicated in fstab(5) entries or manual mount(8)
invocations.

Given the example configuation above, /media is correctly mounted with
`setuid=off` translated into `nosuid`:

```
$ zfs get -Ho value setuid /media
off
$ findmnt -t zfs -no options /media
rw,nosuid,nodev,noexec,noatime,xattr,posixacl
```

/nix however was mounted with default mount(8) options:
```
$ zfs get -Ho value setuid /nix
off
$ findmnt -t zfs -no options /nix
rw,relatime,xattr,noacl
```

This holds true for all other ZFS properties/mount options, including
`exec/[no]exec`, `devices/[no]dev`, `atime/[no]atime`, etc.

/nix is mounted using BusyBox's `mount` during stage 1 init while /media
is mounted later using proper systemd and/or util-linux's `mount`.

Tracing stage 1 init showed that BusyBox never tried to execute
mount.zfs(8) as intended by `zfsutil`.

Replacing it with util-linux's `mount` and adding the mount helper
showed attempts to execute mount.zfs(8).

Ensure ZFS filesystems are mounted with correct options iff `zfsutil` is
used.
2022-05-26 22:16:53 +02:00
..
config Merge pull request #168168 from fedeinthemix/home-mode 2022-05-23 12:27:49 +02:00
hardware nixos: don't put non-firmware in hardware.firmware 2022-05-12 15:17:51 +00:00
i18n/input-method nixos/fcitx5: add the setting of RIME_DATA_DIR and options for rime-data 2022-04-25 13:39:19 +08:00
installer Merge #172668: installation-cd: add more guest tools to NixOS graphical installation base 2022-05-19 12:12:10 +02:00
misc nixos/locate: clarification in warning message (#173247) 2022-05-17 16:47:33 +02:00
profiles Merge pull request #169113 from ElvishJerricco/systemd-stage-1-installer-tests 2022-04-30 13:18:57 -07:00
programs nixos/gnupg: default to a reasonable pinentry program on headless systems 2022-05-18 18:31:34 +02:00
security Merge pull request #156822 from xfix/wrapper-assert-argc-at-least-one 2022-05-16 18:52:51 +02:00
services nixos/timetagger: drop non-evaluating service files 2022-05-25 21:24:48 +02:00
system nixos/stage-1: Ensure correct ZFS mount options 2022-05-26 22:16:53 +02:00
tasks Merge pull request #171650 from helsinki-systems/feat/config-systemd-package 2022-05-09 10:23:04 +02:00
testing nixos/version: Warn about using the default of system.stateVersion 2022-05-05 12:22:31 +02:00
virtualisation Merge pull request #172131 from euank/ena-2.7.1 2022-05-12 01:38:24 +03:00
module-list.nix Merge pull request #153481 from Tchekda/submit/bird-lg 2022-05-25 18:20:58 +02:00
rename.nix nixos/ssmtp: drop module 2022-04-17 00:44:50 +02:00