Commit Graph

86 Commits

Author SHA1 Message Date
Philip Taron
64d047a9ce nixos/amazon-image: do not force-load xen-blkfront kernel module (#313933) 2026-04-01 22:14:29 +00:00
Philip Taron
d09e847072 nixos/ec2-metadata-fetcher: add lzip user-data decompression
Support decompressing lzip-compressed EC2 user data via lzip -dc.
Includes a corresponding NixOS test.
2026-03-24 14:51:59 -07:00
Philip Taron
f3b392af9b nixos/ec2-metadata-fetcher: add zstd user-data decompression
Support decompressing Zstandard-compressed EC2 user data via zstdcat.
Includes a corresponding NixOS test.
2026-03-24 14:51:59 -07:00
Philip Taron
e3789300b1 nixos/ec2-metadata-fetcher: add xz user-data decompression
Support decompressing XZ-compressed EC2 user data via xzcat.
Includes a corresponding NixOS test.
2026-03-24 14:51:59 -07:00
Philip Taron
45d8ed8f4e nixos/ec2-metadata-fetcher: add bzip2 user-data decompression
Refactor try_decompress to use a decompress_cmd variable, making it
straightforward to add new compression formats. Add bzip2 support
and a corresponding NixOS test.
2026-03-24 14:51:58 -07:00
Johnny Walker
80a4ce9ab8 nixos/ec2-metadata-fetcher: decompress gzip-compressed user data
Closes https://github.com/NixOS/nixpkgs/issues/290336
2026-03-24 14:51:56 -07:00
edef
323d269a24 nixos/amazon: move nvme_core.io_timeout to runtime module
This kernel parameter was accidentally added to the image builder module
in 2018 (e4777ae2d8) when it should have been in the runtime config.
This causes a mismatch between AMIs built with the builder and systems
configured with just the runtime module.

Move it to modules/virtualisation/amazon-image.nix so that all EC2
instances get the recommended NVMe timeout, regardless of how they
were provisioned.
2026-01-11 00:07:19 +00:00
Silvan Mosberger
374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Wolfgang Walther
c0e2fbbcad nixos/amazon-image: fix eval 2025-02-02 13:29:03 +01:00
Jörg Thalheim
ce99e2aa18 amazon: make fileSystems option disko-compatible
When using disko, the user can choose their own filesystem layout.
In that case we don't want to specify fileSystems with normal priority
as it would not allow disko to set its own values.
2025-01-27 22:09:20 +01:00
Philip Taron
2e17c4a4da nixos/amazon-image: avoid top-level with statements 2024-07-15 22:02:39 -07:00
Arian van Putten
20f01aa76c nixos/amazon-image: do not force-load xen-blkfront kernel module
Most AWS instances use Nitro Hypervisor these days which
expose EBS volumes as nvme disks.

And even on previous-generation instances that still use Xen
(like T2) the  xen-blkfront module will be loaded automatically
due to the presence of a modalias.

This fixes #46881
2024-05-23 11:03:38 +02:00
Jack Kelly
dc158268f7 nixos/amazon-image: Enable Amazon SSM Agent by default
Amazon-provided EC2 images do this.

See: https://docs.aws.amazon.com/systems-manager/latest/userguide/ami-preinstalled-agent.html
2024-03-08 16:24:00 +10:00
Arian van Putten
a1232992ac nixos/amazon-image: Take over maintainership
I am actively working on bringing back Amazon Images for 24.05.
Please track progress in https://github.com/nixos/amis
2024-02-09 18:02:40 +01:00
Jade Lovelace
fe474ed61a nixos: fix remaining services for network-online dep fix 2024-01-19 00:11:34 -08:00
Nicholas Sielicki
33397faec9 ena: 2.8.0 -> 2.8.2
* Notably, fixes build on kernel >= 5.17

Signed-off-by: Nicholas Sielicki <git@opensource.nslick.com>
2023-01-31 03:31:05 +00:00
Matthieu Coudron
cf10d7aef8 services.openssh: support freeform settings (#193757)
* services.openssh: support freeform settings

Keep "extraConfig" but introduces "settings".

Also renames several options

(mkRenamedOptionModule [ "services" "openssh" "kbdInteractiveAuthentication" ] [  "services" "openssh" "settings" "KbdInteractiveAuthentication" ])
(mkRenamedOptionModule [ "services" "openssh" "passwordAuthentication" ] [  "services" "openssh" "settings" "PasswordAuthentication" ])
(mkRenamedOptionModule [ "services" "openssh" "useDns" ] [  "services" "openssh" "settings" "UseDns" ])
(mkRenamedOptionModule [ "services" "openssh" "permitRootLogin" ] [  "services" "openssh" "settings" "PermitRootLogin" ])

* updated doc
* regen doc
2023-01-15 16:32:46 +01:00
Linus Heckemann
36ca2b495f nixos/ec2: use only curl in metadata fetcher, log to console
We don't need both wget and curl, so let's use only curl (which is
part of a minimal NixOS closure, unlike wget).

Logging to the console is helpful for debugging.
2022-11-23 17:19:16 +01:00
Linus Heckemann
eddfcf8622 amazon-image: fetch metadata only in stage-2
This also removes automatic enablement/mounting of instance store swap
devices and ext3 filesystems. This behaviour is strongly opinionated
and shouldn't be enabled by default.

The unionfs behaviour never took effect anyway, because the AMI
manifest path only exists for instance store-backed AMIs, which have
not been supported by nixpkgs since
84742e2293 (2019).
2022-11-23 17:19:13 +01:00
Linus Heckemann
24e33a4d2e nixos/ec2: remove paravirtualization-specific code
Paravirtualized EC2 instances haven't been supported since 2017.
It's safe to remove this now.
2022-11-23 17:18:18 +01:00
Euan Kemp
35cfe2c29c nixos/amazon-image: default to 5.15 kernel
Previously, it was held back due to the ENA driver not building on the
current default (5.15). The previous commit bumps the ENA driver, which
allows 5.15 to work.
2022-05-08 21:13:50 -07:00
zowoq
177281ad00 nixos/amazon-image: use 5_10 kernel and add assert 2022-02-27 15:04:37 -08:00
Tom Prince
653a3e4ed0 amazon-ec2-utils: 1.2 -> 2.0
This also replaces the ec2-utils package, which is an older version.
2022-02-04 12:53:58 -07:00
Graham Christensen
bd38b059ea NixOS/amazonImageZfs: init
Introduce an AWS EC2 AMI which supports aarch64 and x86_64 with a ZFS
root.

This uses `make-zfs-image` which implies two EBS volumes are needed
inside EC2, one for boot, one for root. It should not matter which
is identified `xvda` and which is `xvdb`, though I have always
uploaded `boot` as `xvda`.
2021-08-25 10:42:35 -04:00
Your Name
c042c1a1f8 NixOS AWS AMI: Create boot entries for each system generation 2021-08-20 14:02:11 -04:00
Your Name
1b79176310 NixOS AWS AMI: enable the serial console on ttyS0 2021-08-20 12:42:02 -04:00
Your Name
54aa35d40e NixOS AWS AMI: Configure Grub's serial console
See:

* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-os.html
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/grub.html
2021-08-20 11:22:45 -04:00
Your Name
bfd2f800ee NixOS AMI: Give grub a 1s timeout now that AWS has emergency console access.
See:

* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-os.html
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/grub.html
2021-08-20 11:22:39 -04:00
Your Name
0ccd6448d6 NixOS AWS AMI: Set the console to 115200n8
See:

* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-os.html
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/grub.html
2021-08-20 11:15:31 -04:00
Graham Christensen
bc49a0815a utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Graham Christensen
83ea88e03f nixos: ec2 ami: support IMDSv2
AWS's metadata service has two versions. Version 1 allowed plain HTTP
requests to get metadata. However, this was frequently abused when a
user could trick an AWS-hosted server in to proxying requests to the
metadata service. Since the metadata service is frequently used to
generate AWS access keys, this is pretty gnarly. Version two is
identical except it requires the caller to request a token and provide
it on each request.

Today, starting a NixOS AMI in EC2 where the metadata service is
configured to only allow v2 requests fails: the user's SSH key is not
placed, and configuration provided by the user-data is not applied.
The server is useless. This patch addresses that.

Note the dependency on curl is not a joyful one, and it expand the
initrd by 30M. However, see the added comment for more information
about why this is needed. Note the idea of using `echo` and `nc` are
laughable. Don't do that.
2020-11-19 13:00:56 -05:00
Graham Christensen
c851030763 amazon-image: random.trust_cpu=on to cut 10s from boot
Ubuntu and other distros already have this set via kernel config.
2020-10-30 13:45:19 -04:00
Jörg Thalheim
b55a7a3a57 ec2-utils: init at 0.5.1, include in amazon-image profile (#67347)
ec2-utils: init at 0.5.1, include in amazon-image profile
2019-11-01 20:57:44 +00:00
Jan Tojnar
ed54a5b51d Merge branch 'gtk-no-plus' 2019-09-06 02:57:51 +02:00
Jan Tojnar
72e7d569a7 tree-wide: s/GTK+/GTK/g
GTK was renamed.
2019-09-06 02:54:53 +02:00
Andrew Childs
5501274b5f amazon-image.nix: add EFI support, enable by default for aarch64 2019-09-05 00:52:17 +09:00
Andrew Childs
4c446b8268 amazon-image: include ec2-utils in udev rules
This sets up device mappings like /dev/xvda -> /dev/nvme0n1
2019-08-23 23:27:49 +09:00
Peter Hoeg
503ca1f40c nixos aws: use in-kernel ixgbevf driver (#58956) 2019-08-15 02:58:22 +03:00
talyz
261372b69c amazon-image.nix: Resolve failure to include resize2fs
Since 34234dcb51, for resize2fs to be automatically included in
initrd, a filesystem needed for boot must be explicitly defined as an
ext* type filesystem.
2019-03-15 17:33:45 +01:00
Antoine Eiche
933da6de91 nixos: Add ec2-metadata-fetcher.nix file
To share the metadata fetcher script between ec2 and Openstack images.
2019-02-11 20:58:45 +01:00
Florian Klink
4d51002216 Merge pull request #49650 from srghma/srghma-patch-1
amazon-image: fix typo in comment
2018-11-03 16:04:47 +01:00
Eelco Dolstra
0bdd0d8e04 amazon-image.nix: Disable udisks
This reduces the system closure by 89 MiB.
2018-10-15 21:54:28 +02:00
Sergei Khoma
c4cad45082 fix typo
based on https://www.ec2instances.info/
2018-06-03 20:03:34 +03:00
Ihor Antonov
08ebd830a5 Fix kernel crash caused by absent root device 2018-05-12 02:55:33 +03:00
zimbatm
eddf30cc93 nixos: introduce boot.growPartition (#33521)
Move it from being a profile
2018-01-06 13:52:51 +00:00
Daniel Peebles
5fd528d043 amazon-image: use NTP provided by the hypervisor
See http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html for more information.

Fixes #32187
2017-11-29 22:48:00 -05:00
Eelco Dolstra
54da9cc944 Amazon image: Add NVMe support to the initrd
This is required by the new c5.* instance types.

Note that this changes disk names from /dev/xvd* to
/dev/nvme0n*. Amazon Linux has a udev rule that calls a Python script
named "ec2nvme-nsid" to create compatibility symlinks. We could use
that, but it would mean adding Python to the AMI closure...
2017-11-09 17:53:26 +01:00
Eelco Dolstra
35dbcbb296 Fix eval error due to config.ec2.hvm 2017-04-04 13:49:13 +02:00
Eelco Dolstra
d496f23df0 amazon-image.nix: Remove redundant log message
(cherry picked from commit c4b5ed5db74cde94b19d519a8d875e3f7df48a76)
2017-01-03 17:32:47 +01:00
Anmol Sethi
6891bb1c59 openssh: support prohibit-password for permitRootLogin
See 1dc8d93ce6

I also made it the default.
2016-10-01 13:23:56 -04:00