dotfiles/system/nixos/unpackerr.nix

28 lines
763 B
Nix
Raw Normal View History

2023-05-21 21:14:53 +00:00
{ pkgs, config, ... }:
{
systemd.services.unpackerr =
let
mounts = [ "mnt-downloads.mount" ];
in
{
description = "unpackerr service";
requires = mounts;
bindsTo = [ "wg.service" ];
after = [ "wg.service" ] ++ mounts;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "media_user";
Group = "media_group";
NetworkNamespacePath = "/var/run/netns/wg";
BindReadOnlyPaths = [
"/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind"
"/etc/netns/wg/nsswitch.conf:/etc/nsswitch.conf:norbind"
];
ExecStart = "${pkgs.unpackerr}/bin/unpackerr --config ${config.age.secrets.unpackerr-config.path}";
};
};
}