1 { config, lib, pkgs, ... }:
3 inherit (lib) literalExpression types;
9 enable = lib.mkOption {
13 Whether the OpenStack instance uses a ZFS root.
17 datasets = lib.mkOption {
19 Datasets to create under the `tank` and `boot` zpools.
21 **NOTE:** This option is used only at image creation time, and
22 does not attempt to declaratively create or manage datasets
23 on an existing system.
28 type = types.attrsOf (types.submodule {
30 mount = lib.mkOption {
31 description = "Where to mount this dataset.";
32 type = types.nullOr types.str;
36 properties = lib.mkOption {
37 description = "Properties to set on this dataset.";
38 type = types.attrsOf types.str;
47 default = pkgs.stdenv.hostPlatform.isAarch64;
48 defaultText = literalExpression "pkgs.stdenv.hostPlatform.isAarch64";
51 Whether the instance is using EFI.
57 config = lib.mkIf config.openstack.zfs.enable {
58 networking.hostId = lib.mkDefault "00000000";
62 mountable = lib.filterAttrs (_: value: ((value.mount or null) != null)) config.openstack.zfs.datasets;
65 (dataset: opts: lib.nameValuePair opts.mount {