amazon-ssm-agent: remove overrideEtc parameter

This was meant to make amazon-ssm-agent work "out of the box" on non-NixOS
systems but the feature never really worked.

The problem is that amazon-ssm-agent looks for the files "amazon-ssm-agent.json"
and "seelog.xml" but the files in the package are named
"amazon-ssm-agent.json.template" and "seelog.xml.template". So even with
this overrideEtc = true it would not be able to find the config.

E.g. you'd get an error like

Error occurred fetching the seelog config file path:  open /nix/store/pyfxjr0i0hszcj9b6fqly6344zf9zhcb-amazon-ssm-agent-3.3.484.0/etc/amazon/ssm/seelog.xml: no such file or directory
on startup.

Removing this parameter from the from the package doesn't break things as it didn't work in the first place.
This commit is contained in:
Arian van Putten 2024-06-12 11:50:17 +02:00
parent c1dcaef740
commit 494442762c
2 changed files with 1 additions and 11 deletions

View File

@ -28,13 +28,7 @@ in {
options.services.amazon-ssm-agent = {
enable = mkEnableOption "Amazon SSM agent";
package = mkOption {
type = types.path;
description = "The Amazon SSM agent package to use";
default = pkgs.amazon-ssm-agent.override { overrideEtc = false; };
defaultText = literalExpression "pkgs.amazon-ssm-agent.override { overrideEtc = false; }";
};
package = mkPackageOption pkgs "amazon-ssm-agent" {};
};
config = mkIf cfg.enable {

View File

@ -14,7 +14,6 @@
, nixosTests
, testers
, amazon-ssm-agent
, overrideEtc ? true
}:
let
@ -96,9 +95,6 @@ buildGoModule rec {
--replace "/sbin/shutdown" "shutdown"
echo "${version}" > VERSION
'' + lib.optionalString overrideEtc ''
substituteInPlace agent/appconfig/constants_unix.go \
--replace '"/etc/amazon/ssm/"' '"${placeholder "out"}/etc/amazon/ssm/"'
'' + lib.optionalString stdenv.isLinux ''
substituteInPlace agent/managedInstances/fingerprint/hardwareInfo_unix.go \
--replace /usr/sbin/dmidecode ${dmidecode}/bin/dmidecode