changed copyparty-env script to copyparty-hash.

This commit is contained in:
Gabe Venberg 2025-04-25 11:59:28 +02:00
parent 9ce4839cf2
commit 7c9cc76847

View file

@ -70,7 +70,7 @@ in {
''; '';
}; };
mkWrapper = mkOption { mkHashWrapper = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = '' description = ''
@ -351,15 +351,18 @@ in {
home = lib.mkIf cfg.separateHist externalStateDir; home = lib.mkIf cfg.separateHist externalStateDir;
isSystemUser = true; isSystemUser = true;
}; };
environment.systemPackages = lib.mkIf cfg.mkWrapper [ environment.systemPackages = lib.mkIf cfg.mkHashWrapper [
( (
let let
command = '' command = ''
${getExe cfg.package} -c ${runtimeConfigPath} \ ${getExe cfg.package} -c ${runtimeConfigPath} \
${optionalString (cfg.separateHist) "--hist ${externalCacheDir}"} \ ${optionalString (cfg.separateHist) "--hist ${externalCacheDir}"} \
--shr-db ''' \
--ses-db ''' \
--ah-cli \
''; '';
in in
pkgs.writeShellScriptBin "copyparty-env" '' pkgs.writeShellScriptBin "copyparty-hash" ''
set -a # automatically export variables set -a # automatically export variables
# set same environment variables as the systemd service # set same environment variables as the systemd service
${lib.pipe config.systemd.services.copyparty.environment [ ${lib.pipe config.systemd.services.copyparty.environment [
@ -369,7 +372,7 @@ in {
]} ]}
PATH=${config.systemd.services.copyparty.environment.PATH}:$PATH PATH=${config.systemd.services.copyparty.environment.PATH}:$PATH
exec ${command} "$@" exec ${command}
'' ''
) )
]; ];