mirror of
https://github.com/nix-community/disko.git
synced 2026-12-04 06:53:28 +01:00
Fix(zfs_volume); Volume mount/unmount with encryption
- Fix consistent use of fully qualified dataset path - Add idempotent unmounting with encryption keys
This commit is contained in:
1 parent
03e19b4f67
commit
5c7406ecc5
1 file changed
+7
-5
@@ -88,8 +88,8 @@
|
|||||||
default = {
|
default = {
|
||||||
dev = ''
|
dev = ''
|
||||||
${lib.optionalString (config.options.keylocation or "none" != "none") ''
|
${lib.optionalString (config.options.keylocation or "none" != "none") ''
|
||||||
if [ "$(zfs get keystatus ${config.name} -H -o value)" == "unavailable" ]; then
|
if [ "$(zfs get keystatus ${config._name} -H -o value)" == "unavailable" ]; then
|
||||||
zfs load-key ${config.name}
|
zfs load-key ${config._name}
|
||||||
fi
|
fi
|
||||||
''}
|
''}
|
||||||
|
|
||||||
@@ -102,9 +102,11 @@
|
|||||||
inherit config options;
|
inherit config options;
|
||||||
default = {
|
default = {
|
||||||
dev = ''
|
dev = ''
|
||||||
${lib.optionalString (
|
${lib.optionalString (config.options.keylocation or "none" != "none") ''
|
||||||
config.options.keylocation or "none" != "none"
|
if [ "$(zfs get keystatus ${config._name} -H -o value)" == "available" ]; then
|
||||||
) "zfs unload-key ${config.name}"}
|
zfs unload-key ${config._name}
|
||||||
|
fi
|
||||||
|
''}
|
||||||
|
|
||||||
${config.content._unmount.dev or ""}
|
${config.content._unmount.dev or ""}
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in new issue
Block a user