3
0
Fork 0
forked from mirrors/nixpkgs

ssm-agent: copy files required for agent startup

This commit is contained in:
Joe DeVivo 2021-05-04 18:13:42 -07:00 committed by Cole Helbling
parent 96458445e2
commit 27b4fd19ed

View file

@ -63,6 +63,9 @@ buildGoPackage rec {
substituteInPlace agent/session/shell/shell_unix.go \
--replace '"script"' '"${util-linux}/bin/script"'
substituteInPlace agent/appconfig/constants_unix.go \
--replace '"/etc/amazon/ssm/"' '"${placeholder "out"}/etc/amazon/ssm/"'
echo "${version}" > VERSION
'';
@ -96,6 +99,20 @@ buildGoPackage rec {
popd
'';
# These templates retain their `.template` extensions on installation. The
# amazon-ssm-agent.json.template is required as default configuration when an
# amazon-ssm-agent.json isn't present. Here, we retain the template to show
# we're using the default configuration.
# seelog.xml isn't actually required to run, but it does ship as a template
# with debian packages, so it's here for reference. Future work in the nixos
# module could use this template and substitute a different log level.
postInstall = ''
mkdir -p $out/etc/amazon/ssm
cp go/src/${goPackagePath}/amazon-ssm-agent.json.template $out/etc/amazon/ssm/amazon-ssm-agent.json.template
cp go/src/${goPackagePath}/seelog_unix.xml $out/etc/amazon/ssm/seelog.xml.template
'';
postFixup = ''
wrapProgram $out/bin/amazon-ssm-agent --prefix PATH : ${bashInteractive}/bin
'';