Commit Graph

71 Commits

Author SHA1 Message Date
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
Nathan Zadoks
346c31000b amazon-grow-partition module: rename to grow-partition 2016-08-30 16:48:04 -04:00
Eelco Dolstra
56badfee94 amazon-image.nix: Add the ena driver
This is necessary for Enhanced Networking on x1.* instances.
2016-07-11 14:32:18 +02:00
Eelco Dolstra
3adb769776 amazon-image.nix: Add the ixgbevf driver 2016-07-07 17:51:15 +02:00
Eelco Dolstra
32bed83b18 Remove boot.loader.grub.timeout and boot.loader.gummiboot.timeout
There is a generic boot.loader.timeout option.
2016-05-25 11:39:17 +02:00
Eelco Dolstra
0d3738cdcc Fix the EC2 test
We now generate a qcow2 image to prevent hitting Hydra's output size
limit. Also updated /root/user-data -> /etc/ec2-metadata/user-data.

http://hydra.nixos.org/build/33843133
2016-03-30 21:50:23 +02:00
Rob Vermaas
ed5920ec65 Remove kill -9 -1 from initrd of amazon-image.nix. This causes a kernel panic. 2016-03-09 09:55:25 +00:00
Eelco Dolstra
2701665904 Fetch all EC2 metadata / user data in the initrd
Since we're already fetching one datum, we may as well fetch the
others needed by fetch-ec2-data. This also eliminates the dependency
on wget.
2016-02-04 15:45:54 +01:00
Eelco Dolstra
e618492168 Revert "Do not relocate /nix and /tmp to small disks on AWS"
This reverts commit f10bead8fd because
it doesn't work - there is no lsblk in the initrd, and there is a
missing backslash.
2016-02-02 19:59:28 +01:00
Eelco Dolstra
cc925d0506 boot.initrd.network: Support DHCP
This allows us to use it for EC2 instances.
2016-02-02 19:59:27 +01:00
Eelco Dolstra
06731dfcae ec2: Don't use ephemeral disks for /nix unionfs
This is a regression introduced by merging the EBS and S3 images. The
EBS images had a special marker /.ebs to prevent the initrd from using
ephemeral storage for the unionfs, but this marker was missing in the
consolidated image.

The fix is to check the file ami-manifest-path on the metadata server
to see if we're an S3-based instance. This does require networking in
the initrd.

Issue #12613.
2016-02-02 19:59:27 +01:00
cransom user
f10bead8fd Do not relocate /nix and /tmp to small disks on AWS
The default behavior with an m3.medium instance is to relocate
/nix and /tmp to /disk0 because an assumption is made that any
ephemeral disk is larger than the root volume.  Rather than make
that assumption, add a check to see if the disk is larger, and
only then relocate /nix and /tmp.

This addresses https://github.com/NixOS/nixpkgs/issues/12613
2016-02-02 01:40:41 +00:00
Dan Peebles
cd7612b841 amazon-image: enable configure-from-userdata and the corresponding VM test 2015-12-30 04:59:52 +00:00
Eelco Dolstra
cab1483a95 Blacklist the xen_fbfront kernel module
This gets rid of a 30 second delay during boot. See e.g
https://github.com/coreos/bugs/issues/208.
2015-09-28 22:15:47 +02:00
Eelco Dolstra
640dff2918 Fix GRUB syntax in EC2 HVM images
There is no "root" command in GRUB 2, and it's not needed anyway. This
command delayed HVM boots for a few seconds.
2015-09-28 13:47:14 +02:00
Eelco Dolstra
aeb31b97ad Update AMI generator
The EBS and S3 (instance-store) AMIs are now created from the same
image. HVM instance-store AMIs are also generated.

Disk image generation has been factored out into a function
(nixos/lib/make-disk-image.nix) that can be used to build other kinds
of images.
2015-09-27 21:06:40 +02:00