Revert "added environment script."

Cant have 2 instances of copyparty running, even if one is just for
ah-cli...

This reverts commit c60c8d8e0b.
This commit is contained in:
Gabe Venberg 2025-04-23 11:32:30 +02:00
parent c60c8d8e0b
commit a54e950ecc

View file

@ -70,15 +70,6 @@ in {
''; '';
}; };
mkWrapper = mkOption {
type = types.bool;
default = true;
description = ''
Make a shell script wrapper called 'copyparty-env' with all options set here,
for ease of things like password hashing
'';
};
user = mkOption { user = mkOption {
type = types.str; type = types.str;
default = "copyparty"; default = "copyparty";
@ -333,27 +324,5 @@ in {
home = lib.mkIf externalStateDir; home = lib.mkIf externalStateDir;
isSystemUser = true; isSystemUser = true;
}; };
environment.systemPackages = lib.mkIf cfg.mkWrapper [
(
let
command = ''
${getExe cfg.package} -c ${runtimeConfigPath} \
${optionalString (cfg.seperateHist) "--hist ${externalCacheDir}"} \
'';
in
pkgs.writeShellScriptBin "copyparty-env" ''
set -a # automatically export variables
# set same environment variables as the systemd service
${lib.pipe config.systemd.services.copyparty.environment [
(lib.filterAttrs (n: v: v != null && n != "PATH"))
(lib.mapAttrs (_: v: "${v}"))
(lib.toShellVars)
]}
PATH=${config.systemd.services.copyparty.environment.PATH}:$PATH
exec ${command} "$@"
''
)
];
}; };
} }