Merge pull request #327559 from philiptaron/issue-208242/amazon-image.nix

nixos/amazon-image: remove top-level `with lib`
This commit is contained in:
Arian van Putten 2024-07-16 09:19:20 +02:00 committed by GitHub
commit c15e510e6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -1,8 +1,8 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) mkOption optionalString types versionAtLeast;
inherit (lib.options) literalExpression;
cfg = config.amazonImage;
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
config.boot.kernelParams =
let timeout =
if pkgs.lib.versionAtLeast config.boot.kernelPackages.kernel.version "4.15"
if versionAtLeast config.boot.kernelPackages.kernel.version "4.15"
then "4294967295"
else "255";
in [ "nvme_core.io_timeout=${timeout}" ];
@ -156,5 +156,5 @@ in {
};
in if config.ec2.zfs.enable then zfsBuilder else extBuilder;
meta.maintainers = with maintainers; [ arianvp ];
meta.maintainers = with lib.maintainers; [ arianvp ];
}

View File

@ -6,9 +6,8 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) mkDefault mkIf;
cfg = config.ec2;
in
@ -107,5 +106,5 @@ in
# (e.g. it depends on GTK).
services.udisks2.enable = false;
};
meta.maintainers = with maintainers; [ arianvp ];
meta.maintainers = with lib.maintainers; [ arianvp ];
}