diff options
author | Benjamin Hipple <bhipple@protonmail.com> | 2020-03-15 19:18:51 -0400 |
---|---|---|
committer | Benjamin Hipple <bhipple@protonmail.com> | 2020-03-22 00:35:56 -0400 |
commit | 129176452c3286ad5806fff194969cc8dba4ba4c (patch) | |
tree | 2867c7f8ad2e58d5690e92c4a4a4143fe3ce60d8 /nixos/maintainers | |
parent | 81d84153c790ab80490139a01b60481cab7497a9 (diff) | |
download | nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar.gz nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar.bz2 nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar.lz nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar.xz nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.tar.zst nixpkgs-129176452c3286ad5806fff194969cc8dba4ba4c.zip |
nixos-ami: update nvme_core.io_timeout for linux kernel >= 4.15
NixOS 20.03 is built on kernel 5.4 and 19.09 is on 4.19, so we should update this option to the highest value possible, per linked upstream instructions from Amazon.
Diffstat (limited to 'nixos/maintainers')
-rw-r--r-- | nixos/maintainers/scripts/ec2/amazon-image.nix | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nixos/maintainers/scripts/ec2/amazon-image.nix b/nixos/maintainers/scripts/ec2/amazon-image.nix index 31e15537179..36f3e7af873 100644 --- a/nixos/maintainers/scripts/ec2/amazon-image.nix +++ b/nixos/maintainers/scripts/ec2/amazon-image.nix @@ -8,10 +8,15 @@ in { imports = [ ../../../modules/virtualisation/amazon-image.nix ]; - # Required to provide good EBS experience, + # Amazon recomments setting this to the highest possible value for a good EBS + # experience, which prior to 4.15 was 255. # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html#timeout-nvme-ebs-volumes - # TODO change value to 4294967295 when kernel is updated to 4.15 or later - config.boot.kernelParams = [ "nvme_core.io_timeout=255" ]; + config.boot.kernelParams = + let timeout = + if pkgs.lib.versionAtLeast config.boot.kernelPackages.kernel.version "4.15" + then "4294967295" + else "255"; + in [ "nvme_core.io_timeout=${timeout}" ]; options.amazonImage = { name = mkOption { |