amazon-ec2-utils: 0.5.1 -> 1.3
This commit is contained in:
parent
7a86a9505c
commit
4caaec36dd
@ -137,7 +137,7 @@ in
|
||||
services.openssh.permitRootLogin = "prohibit-password";
|
||||
|
||||
# Creates symlinks for block device names.
|
||||
services.udev.packages = [ pkgs.ec2-utils ];
|
||||
services.udev.packages = [ pkgs.amazon-ec2-utils ];
|
||||
|
||||
# Force getting the hostname from EC2.
|
||||
networking.hostName = mkDefault "";
|
||||
|
42
pkgs/tools/virtualization/amazon-ec2-utils/default.nix
Normal file
42
pkgs/tools/virtualization/amazon-ec2-utils/default.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{ stdenv, lib, fetchFromGitHub, python3, installShellFiles }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "amazon-ec2-utils";
|
||||
version = "1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aws";
|
||||
repo = "amazon-ec2-utils";
|
||||
rev = version;
|
||||
sha256 = "sha256-uxKnbdKGhS32kY3mA7YYtDRwKcEjNZPJUYQExZTqtxE=";
|
||||
};
|
||||
|
||||
buildInputs = [ python3 ];
|
||||
# TODO next version will have manpages
|
||||
#nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
installPhase = ''
|
||||
# https://github.com/aws/amazon-ec2-utils/blob/8eb2effb1aea2280264d66ae58b3e156e6d429f9/amazon-ec2-utils.spec#L74
|
||||
install -D --target $out/etc/udev/rules.d *.rules
|
||||
install -D --target $out/bin ec2-metadata ebsnvme-id ec2udev-vbd ec2udev-vcpu
|
||||
install -D --target $out/lib/udev/ ec2nvme-nsid
|
||||
# TODO next version will have manpages
|
||||
#installManPage doc/*
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
for i in $out/etc/udev/rules.d/*.rules; do
|
||||
substituteInPlace "$i" \
|
||||
--replace '/sbin' "$out/bin"
|
||||
done
|
||||
substituteInPlace "$out/etc/udev/rules.d/70-ec2-nvme-devices.rules" \
|
||||
--replace 'ec2nvme-nsid' "$out/lib/udev/ec2nvme-nsid"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A set of tools for running in EC2";
|
||||
homepage = "https://aws.amazon.com/amazon-linux-ami/";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ thefloweringash ];
|
||||
};
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
{ stdenv, lib, rpmextract, fetchurl, python2, tree }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "ec2-utils";
|
||||
version = "0.5.1";
|
||||
|
||||
# The url can be determined by booting an "Amazon Linux 2" and running:
|
||||
# > yumdownloader --urls ec2-utils
|
||||
src = fetchurl {
|
||||
url = "http://amazonlinux.ap-northeast-1.amazonaws.com/blobstore/a3b4d2c35c2300518fe10381a05b3bd7936ff5cdd3d351143a11bf84073d9e00/ec2-utils-0.5-1.amzn2.0.1.noarch.rpm";
|
||||
sha256 = "004y7l3q9gqi78a53lykrpsnz4yp7dds1083w67m2013bk1x5d53";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ rpmextract ];
|
||||
|
||||
buildInputs = [ python2 ];
|
||||
|
||||
unpackPhase = ''
|
||||
mkdir source
|
||||
cd source
|
||||
rpmextract "$src"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
|
||||
mv --target-directory $out \
|
||||
etc sbin usr/bin usr/lib
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
for i in $out/etc/udev/rules.d/*.rules; do
|
||||
substituteInPlace "$i" \
|
||||
--replace '/sbin' "$out/bin"
|
||||
done
|
||||
|
||||
substituteInPlace "$out/etc/udev/rules.d/70-ec2-nvme-devices.rules" \
|
||||
--replace 'ec2nvme-nsid' "$out/lib/udev/ec2nvme-nsid"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "A set of tools for running in EC2";
|
||||
homepage = "https://aws.amazon.com/amazon-linux-ami/";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ thefloweringash ];
|
||||
};
|
||||
}
|
@ -138,6 +138,7 @@ mapAliases ({
|
||||
draftsight = throw "draftsight has been removed, no longer available as freeware"; # added 2020-08-14
|
||||
dvb_apps = throw "dvb_apps has been removed."; # added 2020-11-03
|
||||
dwarf_fortress = dwarf-fortress; # added 2016-01-23
|
||||
ec2-utils = amazon-ec2-utils; # added 2020-12-06
|
||||
emacsPackagesGen = emacsPackagesFor; # added 2018-08-18
|
||||
emacsPackagesNgGen = emacsPackagesFor; # added 2018-08-18
|
||||
emacsPackagesNgFor = emacsPackagesFor; # added 2019-08-07
|
||||
|
@ -997,7 +997,7 @@ in
|
||||
|
||||
ec2_ami_tools = callPackage ../tools/virtualization/ec2-ami-tools { };
|
||||
|
||||
ec2-utils = callPackage ../tools/virtualization/ec2-utils { };
|
||||
amazon-ec2-utils = callPackage ../tools/virtualization/amazon-ec2-utils { };
|
||||
|
||||
exoscale-cli = callPackage ../tools/admin/exoscale-cli { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user