about summary refs log tree commit diff
path: root/nixos/maintainers/scripts
AgeCommit message (Collapse)AuthorFilesLines
2022-05-17maintainers/create-amis.sh: Add more AWS regionsArmando Santos1-5/+25
Add all currently available AWS regions
2022-05-03nixos/lxd: improve testsPatryk Wychowaniec1-1/+1
- Make tests/lxd.nix use NixOS's lxdMeta & lxdImage to avoid relying on 3rd party containers such as Alpine Linux for testing purposes. - Merge tests/lxd-image.nix into tests/lxd.nix, since now both have a similar structure. - Extract duplicated inline LXD configuration into a separate file, - Add passthru.lxd-nftables & passthru.lxd-image-server.
2022-04-07openstack-image-zfs: start copying the channel now that we've mostly got the ↵Graham Christensen1-1/+1
expressions down
2022-04-07openstack-image-zfs: make the generated configuration.nix validGraham Christensen1-2/+3
Drops the wrong expandOnBoot option (defaults to all) and mark ZFS as enabled.
2022-04-07openstack-image-zfs: build a single-image ZFS rootGraham Christensen1-16/+1
2022-04-07openstack-image-zfs: don't support vpc type, default to qcow2Graham Christensen1-2/+2
2022-04-07amazon-image: use make-multi-disk-zfs-imageGraham Christensen1-1/+1
2022-04-07openstack-image-zfs: initGraham Christensen1-0/+115
2022-04-07openstack-image: make it easy to disable copying the channel to improve ↵Graham Christensen1-3/+7
iteration time
2022-04-07openstack-image: minor cleanupsGraham Christensen1-7/+4
Format and remove unnecessary `with lib;`.
2022-01-26nixos/nix-daemon: use structural settingspolykernel1-1/+1
The `nix.*` options, apart from options for setting up the daemon itself, currently provide a lot of setting mappings for the Nix daemon configuration. The scope of the mapping yields convience, but the line where an option is considered essential is blurry. For instance, the `extra-sandbox-paths` mapping is provided without its primary consumer, and the corresponding `sandbox-paths` option is also not mapped. The current system increases the maintenance burden as maintainers have to closely follow upstream changes. In this case, there are two state versions of Nix which have to be maintained collectively, with different options avaliable. This commit aims to following the standard outlined in RFC 42[1] to implement a structural setting pattern. The Nix configuration is encoded at its core as key-value pairs which maps nicely to attribute sets, making it feasible to express in the Nix language itself. Some existing options are kept such as `buildMachines` and `registry` which present a simplified interface to managing the respective settings. The interface is exposed as `nix.settings`. Legacy configurations are mapped to their corresponding options under `nix.settings` for backwards compatibility. Various options settings in other nixos modules and relevant tests have been updated to use structural setting for consistency. The generation and validation of the configration file has been modified to use `writeTextFile` instead of `runCommand` for clarity. Note that validation is now mandatory as strict checking of options has been pushed down to the derivation level due to freeformType consuming unmatched options. Furthermore, validation can not occur when cross-compiling due to current limitations. A new option `publicHostKey` was added to the `buildMachines` submodule corresponding to the base64 encoded public host key settings exposed in the builder syntax. The build machine generation was subsequently rewritten to use `concatStringsSep` for better performance by grouping concatenations. [1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2021-11-11create-amis.sh: possible deprecationTimothy DeHerrera1-0/+3
2021-11-10amis: enable setting ami boot mode on registrationTimothy DeHerrera2-0/+6
This is important since legacy bios mode is still the default for Intel and AMD based instances on AWS. That is, even if your image is setup to use UEFI on the OS level, the AMI will still use BIOS unless the boot mode is explicitly set during registration.
2021-11-09create_amis.sh: fix logic for non-zfs amisTimothy DeHerrera1-6/+11
2021-11-03nixosTest.lxdImage: add lxdImage testMaciej Krüger2-7/+1
2021-11-03lxdImage: enable docs & xlibs in standalone imageMaciej Krüger2-0/+9
2021-11-03release.lxdImage: add lxdImage to hydraMaciej Krüger3-0/+142
2021-10-17nixos/maintainers/scripts: Avoid copy in exampleRobert Hensing1-1/+1
2021-10-04Merge pull request #136909 from ncfavier/cleanup-defaults-examplesRobert Hensing1-1/+1
nixos/doc: clean up defaults and examples
2021-10-04nixos/doc: clean up defaults and examplesNaïm Favier1-1/+1
2021-10-03create-amis.sh: fix typoTimothy DeHerrera2-7/+4
2021-10-03create-amis.sh: use status messageTimothy DeHerrera1-3/+3
The progress ID is fairly useless. Status message is more useful for humans.
2021-10-03create-amis.sh: add support for the ZFS AMIsTimothy DeHerrera1-34/+62
2021-10-03create-amis.sh: allow uploading private AMIsTimothy DeHerrera1-2/+2
2021-10-03create-amis.sh: make vars overridable from envTimothy DeHerrera1-6/+10
2021-08-25amazon images: extend the image-info.json to have a disks objectGraham Christensen1-6/+18
Having a disks object with a dictionary of all the disks and their properties makes it easier to process multi-disk images. Note the rename of `label` to `system_label` is because `$label`i is something of a special token to jq.
2021-08-25NixOS/amazonImageZfs: initGraham Christensen2-27/+92
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-05-01amazonImage: make statically sized againLuke Granger-Brown1-1/+1
For reasons we haven't been able to work out, the aarch64 EC2 image now regularly exceeds the output image size on hydra.nixos.org. As a workaround, set this back to being statically sized again. The other images do seem to build - it's just a case of the EC2 image now being too large (occasionally non-determinstically).
2021-04-24treewide: use auto diskSize for make-disk-imagelassulus3-4/+4
(cherry picked from commit f3aa040bcbf39935e7e9ac7a7296eac9da7623ec)
2021-04-24Revert "treewide: use auto diskSize for make-disk-image"Luke Granger-Brown3-4/+4
This reverts commit f3aa040bcbf39935e7e9ac7a7296eac9da7623ec.
2021-04-24Revert "nixos/amazon-image: (temporarily) use fixed disk size again"Luke Granger-Brown1-2/+1
This reverts commit 6a8359a92ab501ae62739e9d3302f48e3e73c750.
2021-04-24nixos/amazon-image: (temporarily) use fixed disk size againLuke Granger-Brown1-1/+2
As a temporary workaround for #120473 while the image builder is patched to correctly look up disk sizes, partially revert f3aa040bcbf39935e7e9ac7a7296eac9da7623ec for EC2 disk images only. We retain the type allowing "auto" but set the default back to the previous value.
2021-04-22treewide: use auto diskSize for make-disk-imagelassulus3-4/+4
2021-03-21add new Google Cloud image for the current releaseAmineChikhaoui1-0/+12
update the create-gce.sh script with the ability to create public images out of a GS object.
2021-01-11amazonImage: Upload disks as GP3 for cheaper & faster IO (#109027)Graham Christensen1-1/+1
GP3 is always faster and cheaper than GP2, so sticking to GP2 is leaving money on the table. https://cloudwiry.com/ebs-gp3-vs-gp2-pricing-comparison/
2020-10-30Merge pull request #102174 from grahamc/ami-root-use-gptGraham Christensen1-1/+1
AMI root partition table: use GPT to support >2T partitions
2020-10-30nixos.amazonAmi: use legacy+gpt disk images to support partitions >2TGraham Christensen1-1/+1
2020-10-30create-amis: improve wording around the service name's IAM roleGraham Christensen1-2/+2
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2020-10-30create-amis: allow customizing the service role nameGraham Christensen1-4/+6
The complete setup on the AWS end can be configured with the following Terraform configuration. It generates a ./credentials.sh which I just copy/pasted in to the create-amis.sh script near the top. Note: the entire stack of users and bucket can be destroyed at the end of the import. variable "region" { type = string } variable "availability_zone" { type = string } provider "aws" { region = var.region } resource "aws_s3_bucket" "nixos-amis" { bucket_prefix = "nixos-amis-" lifecycle_rule { enabled = true abort_incomplete_multipart_upload_days = 1 expiration { days = 7 } } } resource "local_file" "credential-file" { file_permission = "0700" filename = "${path.module}/credentials.sh" sensitive_content = <<SCRIPT export service_role_name="${aws_iam_role.vmimport.name}" export bucket="${aws_s3_bucket.nixos-amis.bucket}" export AWS_ACCESS_KEY_ID="${aws_iam_access_key.uploader.id}" export AWS_SECRET_ACCESS_KEY="${aws_iam_access_key.uploader.secret}" SCRIPT } # The following resources are for the *uploader* resource "aws_iam_user" "uploader" { name = "nixos-amis-uploader" } resource "aws_iam_access_key" "uploader" { user = aws_iam_user.uploader.name } resource "aws_iam_user_policy" "upload-to-nixos-amis" { user = aws_iam_user.uploader.name policy = data.aws_iam_policy_document.upload-policy-document.json } data "aws_iam_policy_document" "upload-policy-document" { statement { effect = "Allow" actions = [ "s3:ListBucket", "s3:GetBucketLocation", ] resources = [ aws_s3_bucket.nixos-amis.arn ] } statement { effect = "Allow" actions = [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", ] resources = [ "${aws_s3_bucket.nixos-amis.arn}/*" ] } statement { effect = "Allow" actions = [ "ec2:ImportSnapshot", "ec2:DescribeImportSnapshotTasks", "ec2:DescribeImportSnapshotTasks", "ec2:RegisterImage", "ec2:DescribeImages" ] resources = [ "*" ] } } # The following resources are for the *vmimport service user* # See: https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-role resource "aws_iam_role" "vmimport" { assume_role_policy = data.aws_iam_policy_document.vmimport-trust.json } resource "aws_iam_role_policy" "vmimport-access" { role = aws_iam_role.vmimport.id policy = data.aws_iam_policy_document.vmimport-access.json } data "aws_iam_policy_document" "vmimport-access" { statement { effect = "Allow" actions = [ "s3:GetBucketLocation", "s3:GetObject", "s3:ListBucket", ] resources = [ aws_s3_bucket.nixos-amis.arn, "${aws_s3_bucket.nixos-amis.arn}/*" ] } statement { effect = "Allow" actions = [ "ec2:ModifySnapshotAttribute", "ec2:CopySnapshot", "ec2:RegisterImage", "ec2:Describe*" ] resources = [ "*" ] } } data "aws_iam_policy_document" "vmimport-trust" { statement { effect = "Allow" principals { type = "Service" identifiers = [ "vmie.amazonaws.com" ] } actions = [ "sts:AssumeRole" ] condition { test = "StringEquals" variable = "sts:ExternalId" values = [ "vmimport" ] } } }
2020-10-30create-amis.sh: log the full response if describing the import snapshot ↵Graham Christensen1-0/+2
tasks fails
2020-10-30nixos ec2/create-amis.sh: shellcheck: $ is not needed in arithmeticGraham Christensen1-1/+1
2020-10-30nixos ec2/create-amis.sh: shellcheck: explicitly make the additions to ↵Graham Christensen1-4/+4
block_device_mappings single strings
2020-10-30nixos ec2/create-amis.sh: shellcheck: read without -r mangles backslashesGraham Christensen1-2/+2
2020-10-30nixos ec2/create-amis.sh: shellcheck: SC2155: Declare and assign separately ↵Graham Christensen1-3/+6
to avoid masking return values.
2020-10-30nixos ec2/create-amis.sh: shellcheck: quote state_dir referenceGraham Christensen1-1/+1
2020-10-30nixos ec2/create-amis.sh: shellcheck: quote region referencesGraham Christensen1-8/+9
2020-08-22Merge pull request #89116 from wagdav/fix-args-create-amisLassulus1-1/+1
nixos/maintainers/scripts/ec2/create-amis.sh: fix argument check
2020-08-16nixos/ec2: remove dependency on NIX_PATHJörg Thalheim1-2/+2
This is required when migrating to flakes
2020-08-04nixos/maintainers/*: editorconfig fixeszowoq3-4/+4
2020-05-28create-amis: fix argument checkDavid Wagner1-1/+1
Because this script enables `set -u` when no arguments are provided bash exits with the error: $1: unbound variable instead of the helpful usage message.