Files
Austin Horstman cc9089ae58 launchd: provide standalone certificate fallback
Standalone agents cannot rely on shell environment variables or Home
Manager updating a system-wide certificate bundle. Prefer the system
bundle and use cacert from Home Manager's Nixpkgs input only when that
path is missing, without modifying system certificates.

Use a small native stat predicate to distinguish ENOENT from permission
and path errors. Preserve explicit certificate variables, including empty
values, and leave nix-darwin's configured bundle selection unchanged.

Cover the absence predicate and update affected launchd fixtures for the
shared command change.
2026-12-02 22:22:46 -06:00

36 lines
706 B
Nix

{
pkgs,
...
}:
{
test.stubs.t3code = { };
programs.t3code = {
enable = true;
server = {
enable = true;
extraArgs = [
"--host"
"0.0.0.0"
"--port"
"3773"
];
};
};
nmt.script =
if pkgs.stdenv.hostPlatform.isDarwin then
''
serviceFile=LaunchAgents/org.nix-community.home.t3code.plist
assertFileExists "$serviceFile"
assertFileContent "$(normalizeStorePaths "$serviceFile")" ${./server.plist}
''
else
''
serviceFile=home-files/.config/systemd/user/t3code.service
assertFileExists "$serviceFile"
assertFileContent "$serviceFile" ${./server.service}
'';
}