Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-nixos-amis: packages nixos/maintainers/scripts/ec2/create-amis.sh #277079

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions nixos/maintainers/scripts/ec2/create-amis.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ stdenv, lib, runtimeShell, coreutils, awscli, jq }:
stdenv.mkDerivation {
name = "create-nixos-amis";

dontUnpack = true;

installPhase =
''
mkdir -p $out/bin
# Replace the nix-shell shebang with bash:
cat << EOF > $out/bin/create-nixos-amis
#!${runtimeShell}
export PATH="${lib.makeBinPath [coreutils awscli jq]}"
EOF
tail -n +3 ${./create-amis.sh} >> $out/bin/create-nixos-amis
chmod 555 $out/bin/create-nixos-amis
'';

meta = with lib; {
description = "A script to create Amazon Machine Images from NixOS systems";
platforms = platforms.unix;
};
}
2 changes: 1 addition & 1 deletion nixos/maintainers/scripts/ec2/create-amis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -p awscli -p jq -p qemu -i bash
#!nix-shell -p awscli -p jq -i bash
# shellcheck shell=bash
#
# Future Deprecation?
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ with pkgs;

nixpkgs-lint = callPackage ../../maintainers/scripts/nixpkgs-lint.nix { };

create-nixos-amis = callPackage ../../nixos/maintainers/scripts/ec2/create-amis.nix { };

common-updater-scripts = callPackage ../common-updater/scripts.nix { };

vimPluginsUpdater = callPackage ../applications/editors/vim/plugins/updater.nix {
Expand Down