nixos/amazon-image: avoid top-level with statements in maintainers script

This commit is contained in:
Philip Taron 2024-07-15 21:51:36 -07:00
parent 7887a3cd00
commit 3ba72e2834
No known key found for this signature in database

View File

@ -1,8 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib) mkOption optionalString types versionAtLeast;
inherit (lib.options) literalExpression;
cfg = config.amazonImage; cfg = config.amazonImage;
amiBootMode = if config.ec2.efi then "uefi" else "legacy-bios"; amiBootMode = if config.ec2.efi then "uefi" else "legacy-bios";
@ -15,7 +15,7 @@ in {
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes
config.boot.kernelParams = config.boot.kernelParams =
let timeout = let timeout =
if pkgs.lib.versionAtLeast config.boot.kernelPackages.kernel.version "4.15" if versionAtLeast config.boot.kernelPackages.kernel.version "4.15"
then "4294967295" then "4294967295"
else "255"; else "255";
in [ "nvme_core.io_timeout=${timeout}" ]; in [ "nvme_core.io_timeout=${timeout}" ];
@ -156,5 +156,5 @@ in {
}; };
in if config.ec2.zfs.enable then zfsBuilder else extBuilder; in if config.ec2.zfs.enable then zfsBuilder else extBuilder;
meta.maintainers = with maintainers; [ arianvp ]; meta.maintainers = with lib.maintainers; [ arianvp ];
} }