1 { config, lib, pkgs, ... }:
3 inherit (lib) literalExpression types;
8 enable = lib.mkOption {
12 Whether the EC2 instance uses a ZFS root.
16 datasets = lib.mkOption {
18 Datasets to create under the `tank` and `boot` zpools.
20 **NOTE:** This option is used only at image creation time, and
21 does not attempt to declaratively create or manage datasets
22 on an existing system.
27 type = types.attrsOf (types.submodule {
29 mount = lib.mkOption {
30 description = "Where to mount this dataset.";
31 type = types.nullOr types.str;
35 properties = lib.mkOption {
36 description = "Properties to set on this dataset.";
37 type = types.attrsOf types.str;
45 default = pkgs.stdenv.hostPlatform.isAarch64;
46 defaultText = literalExpression "pkgs.stdenv.hostPlatform.isAarch64";
49 Whether the EC2 instance is using EFI.
53 description = "Unused legacy option. While support for non-hvm has been dropped, we keep this option around so that NixOps remains compatible with a somewhat recent `nixpkgs` and machines with an old `stateVersion`.";
61 config = lib.mkIf config.ec2.zfs.enable {
62 networking.hostId = lib.mkDefault "00000000";
65 mountable = lib.filterAttrs (_: value: ((value.mount or null) != null)) config.ec2.zfs.datasets;
67 (dataset: opts: lib.nameValuePair opts.mount {