Skip to content

Commit

Permalink
Add extraArgs to zfs_volume.
Browse files Browse the repository at this point in the history
Update lib/types/zfs_volume.nix
  • Loading branch information
neox authored and Mic92 committed Dec 13, 2024
1 parent 0f31ad7 commit a0c967f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/types/zfs_volume.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
default = { };
description = "Options to set for the dataset";
};
extraArgs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = "Extra arguments passed to `zfs create`";
};
mountOptions = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "defaults" ];
Expand Down Expand Up @@ -50,7 +55,7 @@
if ! zfs get type "${config._parent.name}/${config.name}" >/dev/null 2>&1; then
zfs create "${config._parent.name}/${config.name}" \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
-V ${config.size}
-V ${config.size} ${toString (builtins.map lib.escapeShellArg config.extraArgs)}
zvol_wait
partprobe "/dev/zvol/${config._parent.name}/${config.name}"
udevadm trigger --subsystem-match=block
Expand Down

0 comments on commit a0c967f

Please sign in to comment.