mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
nixos/garage: add env-var wrapper for admin cli
This commit is contained in:
parent
8e474340ed
commit
9ec0e31f79
1 changed files with 13 additions and 1 deletions
|
@ -75,7 +75,19 @@ in
|
|||
source = configFile;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ cfg.package ]; # For administration
|
||||
# For administration
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeScriptBin "garage" ''
|
||||
# make it so all future variables set are automatically exported as environment variables
|
||||
set -a
|
||||
|
||||
# source the set environmentFile (since systemd EnvironmentFile is supposed to be a minor subset of posix sh parsing) (with shell arg escaping to avoid quoting issues)
|
||||
[ -f ${lib.escapeShellArg cfg.environmentFile} ] && . ${lib.escapeShellArg cfg.environmentFile}
|
||||
|
||||
# exec the program with quoted args (also with shell arg escaping for the program path to avoid quoting issues there)
|
||||
exec ${lib.escapeShellArg (lib.getExe cfg.package)} "$@"
|
||||
'')
|
||||
];
|
||||
|
||||
systemd.services.garage = {
|
||||
description = "Garage Object Storage (S3 compatible)";
|
||||
|
|
Loading…
Reference in a new issue