mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
changed copyparty-env script to copyparty-hash.
This commit is contained in:
parent
9ce4839cf2
commit
7c9cc76847
|
@ -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}
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue