nix-flake/modules/system/homelab/cdn.nix
satr14 5ca814be31
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 24s
enable hashing
2026-07-19 18:37:10 +07:00

26 lines
928 B
Nix

{ pkgs, ... }: let
python = pkgs.python3.withPackages (ps: with ps; [ pillow argon2-cffi ]);
script = let
version = "v1.20.18";
in pkgs.fetchurl {
url = "https://github.com/9001/copyparty/releases/download/${version}/copyparty-en.py";
hash = "sha256-8SBrKaLPat80n8sONKQYFeFSQXUnCYtwcOU7SR52h7E=";
};
executable = pkgs.writeShellScriptBin "copyparty" ''
exec ${python}/bin/python3 ${script} "$@"
'';
in {
environment.systemPackages = [ executable ];
systemd.services.copyparty = {
description = "File Sharing Service";
enable = true;
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.ffmpeg ];
serviceConfig = {
# ExecStart = "${pkgs.copyparty-most}/bin/copyparty -c /mnt/share/cfg/files.conf";
ExecStart = "${python}/bin/python3 ${script} --ah-alg argon2 -c /mnt/share/cfg/files.conf";
Restart = "on-failure";
};
};
}