2021-03-12 19:10:27 +00:00
|
|
|
{ pkgs, lib, ...}:
|
|
|
|
# docker run -d -p 8081:8081 -v /path/to/downloads:/downloads --user 1001:1001 alexta69/metube
|
|
|
|
with import <stockholm/lib>;
|
|
|
|
let
|
|
|
|
port = "2348";
|
|
|
|
dl-dir = "/media/cryptX/youtube/music";
|
|
|
|
uid = 20421;
|
2021-04-08 19:39:39 +00:00
|
|
|
internal-ip = "192.168.111.11";
|
2021-03-12 19:10:27 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d ${dl-dir} metube nogroup - -"
|
|
|
|
];
|
|
|
|
virtualisation.oci-containers.backend = "docker";
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."tube" = {
|
|
|
|
serverAliases = [ "tube.lan" ];
|
|
|
|
locations."/".proxyPass = "http://localhost:${port}";
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers.metube = {
|
|
|
|
image = "alexta69/metube:latest";
|
|
|
|
ports = [ "${port}:8081" ];
|
|
|
|
volumes = [
|
|
|
|
"${dl-dir}:/downloads"
|
|
|
|
];
|
|
|
|
user = "metube";
|
|
|
|
};
|
2021-06-05 13:52:06 +00:00
|
|
|
users.users.metube = {
|
|
|
|
uid = uid;
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
2021-03-12 19:10:27 +00:00
|
|
|
|
|
|
|
systemd.services.docker-metube.serviceConfig = {
|
|
|
|
StandardOutput = lib.mkForce "journal";
|
|
|
|
StandardError = lib.mkForce "journal";
|
|
|
|
};
|
|
|
|
}
|