summary refs log tree commit diff
path: root/nixos/maintainers
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2013-11-07 14:42:44 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-28 15:46:49 +0200
commitde1c182b0ab3a0e0efe30ea9ac41934bd378eae5 (patch)
tree5ecf27115c1d30cd5f08d3e05a414b111ba9d175 /nixos/maintainers
parent17336efdd8fcfdb830429683684e167d6443bd11 (diff)
downloadnixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar.gz
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar.bz2
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar.lz
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar.xz
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.tar.zst
nixpkgs-de1c182b0ab3a0e0efe30ea9ac41934bd378eae5.zip
Fix EC2 creation script for latest nixops
(cherry picked from commit 361eb3a5f50aba4ecfe08bf37640179dfc2e6453)
Diffstat (limited to 'nixos/maintainers')
-rw-r--r--nixos/maintainers/scripts/ec2/amazon-base-config.nix5
-rwxr-xr-xnixos/maintainers/scripts/ec2/create-ebs-amis.py10
2 files changed, 11 insertions, 4 deletions
diff --git a/nixos/maintainers/scripts/ec2/amazon-base-config.nix b/nixos/maintainers/scripts/ec2/amazon-base-config.nix
new file mode 100644
index 00000000000..d23f15e828b
--- /dev/null
+++ b/nixos/maintainers/scripts/ec2/amazon-base-config.nix
@@ -0,0 +1,5 @@
+{ modulesPath, ...}:
+{
+  imports = [ "${modulesPath}/virtualisation/amazon-config.nix" ];
+  services.journald.rateLimitBurst = 0;
+}
diff --git a/nixos/maintainers/scripts/ec2/create-ebs-amis.py b/nixos/maintainers/scripts/ec2/create-ebs-amis.py
index eab111a2665..4e1aea65980 100755
--- a/nixos/maintainers/scripts/ec2/create-ebs-amis.py
+++ b/nixos/maintainers/scripts/ec2/create-ebs-amis.py
@@ -8,9 +8,11 @@ import nixops.util
 from nixops import deployment
 from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
 import boto.ec2
+from nixops.statefile import StateFile, get_default_state_file
 
 parser = argparse.ArgumentParser(description='Create an EBS-backed NixOS AMI')
 parser.add_argument('--region', dest='region', required=True, help='EC2 region to create the image in')
+parser.add_argument('--channel', dest='channel', default="13.10", help='Channel to use')
 parser.add_argument('--keep', dest='keep', action='store_true', help='Keep NixOps machine after use')
 parser.add_argument('--hvm', dest='hvm', action='store_true', help='Create HVM image')
 parser.add_argument('--key', dest='key_name', action='store_true', help='Keypair used for HVM instance creation', default="rob")
@@ -37,11 +39,11 @@ f.write('''{{
 '''.format(args.region, ebs_size))
 f.close()
 
-db = deployment.open_database(deployment.get_default_state_file())
+db = StateFile(get_default_state_file())
 try:
-    depl = deployment.open_deployment(db, "ebs-creator")
+    depl = db.open_deployment("ebs-creator")
 except Exception:
-    depl = deployment.create_deployment(db)
+    depl = db.create_deployment()
     depl.name = "ebs-creator"
 depl.auto_response = "y"
 depl.nix_exprs = [os.path.abspath("./ebs-creator.nix"), os.path.abspath("./ebs-creator-config.nix")]
@@ -64,7 +66,7 @@ m.run_command("mkdir -p /mnt")
 m.run_command("mount {0} /mnt".format(device))
 m.run_command("touch /mnt/.ebs")
 m.run_command("mkdir -p /mnt/etc/nixos")
-m.run_command("nix-channel --add http://nixos.org/channels/nixos-unstable")
+m.run_command("nix-channel --add http://nixos.org/channels/nixos-{} nixos".format(args.channel))
 m.run_command("nix-channel --update")
 m.run_command("nixos-rebuild switch")
 version = m.run_command("nixos-version", capture_stdout=True).split(' ')[0]