mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
support zfs over legacy fs
This commit is contained in:
parent
722dde361c
commit
9bb4aec964
3 changed files with 65 additions and 13 deletions
24
default.nix
24
default.nix
|
|
@ -179,7 +179,7 @@ let
|
|||
|
||||
create.zpool = q: x: ''
|
||||
zpool create ${q.name} \
|
||||
${lib.optionalString (!isNull x.mode || x.mode != "stripe") x.mode} \
|
||||
${lib.optionalString (!isNull (x.mode or null) && x.mode != "stripe") x.mode} \
|
||||
${lib.optionalString (isAttrs x.options or null) (concatStringsSep " " (mapAttrsToList (n: v: "-o ${n}=${v}") x.options))} \
|
||||
${lib.optionalString (isAttrs x.rootFsOptions or null) (concatStringsSep " " (mapAttrsToList (n: v: "-O ${n}=${v}") x.rootFsOptions))} \
|
||||
''${ZFSDEVICES_${q.name}}
|
||||
|
|
@ -192,11 +192,20 @@ let
|
|||
mount.filesystem = q: x: {
|
||||
fs.${x.mountpoint} = ''
|
||||
if ! findmnt ${q.device} "/mnt${x.mountpoint}" > /dev/null 2>&1; then
|
||||
mount ${q.device} "/mnt${x.mountpoint}" -o X-mount.mkdir
|
||||
mount ${q.device} "/mnt${x.mountpoint}" \
|
||||
-o X-mount.mkdir \
|
||||
${lib.optionalString (isList x.mountOptions or null) (concatStringsSep " " x.mountOptions)}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
mount.zfs_filesystem = q: x:
|
||||
optionalAttrs ((x.options.mountpoint or "") != "none")
|
||||
(mount.filesystem (q // { device = q.dataset; }) (x // { mountOptions = [
|
||||
(lib.optionalString ((x.options.mountpoint or "") != "legacy") "-o zfsutil")
|
||||
"-t zfs"
|
||||
]; }));
|
||||
|
||||
mount.btrfs = mount.filesystem;
|
||||
|
||||
mount.devices = q: x:
|
||||
|
|
@ -285,17 +294,6 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
mount.zfs_filesystem = q: x: {
|
||||
zfs.${q.mountpoint} = lib.optionalString ((x.options.mountpoint or "") != "none") ''
|
||||
if ! findmnt '${q.dataset}' /mnt${q.mountpoint} > /dev/null 2>&1; then
|
||||
mount \
|
||||
${lib.optionalString ((x.options.mountpoint or "") != "legacy") "-o zfsutil"} \
|
||||
-t zfs ${q.dataset} /mnt${q.mountpoint} \
|
||||
-o X-mount.mkdir
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
mount.zfs_volume = q: x:
|
||||
mount-f { device = "/dev/zvol/${q.dataset}"; } x.content;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue