Add AMI publish flake app
This commit is contained in:
@@ -72,11 +72,32 @@
|
||||
exec ${pkgs.nodejs_24}/bin/node ${ami-artifacts-script}/libexec/ami-artifacts/manage-amis.mjs "$@"
|
||||
'';
|
||||
};
|
||||
publish-ami = pkgs.writeShellApplication {
|
||||
name = "publish-ami";
|
||||
runtimeInputs = [
|
||||
pkgs.awscli2
|
||||
pkgs.coreutils
|
||||
pkgs.git
|
||||
pkgs.jq
|
||||
pkgs.opentofu
|
||||
];
|
||||
text = ''
|
||||
git_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
||||
if [ -d "$git_root/tofu/ami-builder" ]; then
|
||||
ami_builder_dir="$git_root/tofu/ami-builder"
|
||||
else
|
||||
ami_builder_dir="$git_root"
|
||||
fi
|
||||
cd "$ami_builder_dir"
|
||||
exec ./publish-ami.sh "$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
rootImage = config.system.build.images.amazon;
|
||||
systemClosure = config.system.build.toplevel;
|
||||
ami-artifacts = ami-artifacts;
|
||||
publish-ami = publish-ami;
|
||||
default = ami-artifacts;
|
||||
});
|
||||
|
||||
@@ -85,6 +106,10 @@
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.ami-artifacts}/bin/ami-artifacts";
|
||||
};
|
||||
publish-ami = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.publish-ami}/bin/publish-ami";
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user