nix/container/Download.nix

30 lines
666 B
Nix
Raw Normal View History

2024-06-09 23:35:53 +03:00
{ container, lib, ... } @args: let
cfg = container.config.download;
2024-06-15 17:49:19 +03:00
memLimit = "4G";
2024-06-09 23:35:53 +03:00
in {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
"data"
];
containers.download = container.mkContainer cfg {
2024-06-14 06:06:05 +03:00
enableTun = true;
2024-06-09 23:35:53 +03:00
bindMounts = {
2024-06-13 17:00:05 +03:00
"/var/lib/deluge/.config/deluge" = {
2024-06-09 23:35:53 +03:00
hostPath = "${cfg.storage}/data";
isReadOnly = false;
};
2024-06-13 17:00:05 +03:00
} // container.attachMedia "download" cfg.download false;
2024-06-09 23:35:53 +03:00
config = { ... }: container.mkContainerConfig cfg {
services.deluge = {
enable = true;
dataDir = "/var/lib/deluge";
web.enable = true;
};
2024-06-15 17:49:19 +03:00
systemd.services.deluged.serviceConfig.MemoryLimit = memLimit;
2024-06-09 23:35:53 +03:00
};
};
}