podman permissions + tranga

This commit is contained in:
Danilo Reyes 2024-11-03 01:43:27 -06:00
parent f0dde95f74
commit c2c66e5d0b
10 changed files with 53 additions and 11 deletions

View File

@ -67,7 +67,10 @@
}; };
users = { users = {
mutableUsers = false; mutableUsers = false;
groups.piracy.gid = 985; groups = {
users.gid = 100;
piracy.gid = 985;
};
}; };
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix = nix =

View File

@ -40,6 +40,7 @@
qbittorrent.enable = true; qbittorrent.enable = true;
sabnzbd.enable = true; sabnzbd.enable = true;
unpackerr.enable = true; unpackerr.enable = true;
tranga.enable = true;
jellyfin = { jellyfin = {
enable = true; enable = true;
enableCron = true; enableCron = true;

View File

@ -50,6 +50,7 @@ in
}; };
}; };
users.users.jawz = { users.users.jawz = {
uid = 1000;
linger = true; linger = true;
isNormalUser = true; isNormalUser = true;
hashedPasswordFile = config.sops.secrets.jawz-password.path; hashedPasswordFile = config.sops.secrets.jawz-password.path;

View File

@ -11,6 +11,7 @@ let
config.my.servers.flameSecret.enable config.my.servers.flameSecret.enable
config.my.servers.metube.enable config.my.servers.metube.enable
config.my.servers.go-vod.enable config.my.servers.go-vod.enable
config.my.servers.tranga.enable
]; ];
in in
{ {
@ -176,6 +177,7 @@ in
enableProxy = lib.mkDefault false; enableProxy = lib.mkDefault false;
}; };
firefly-iii.enable = lib.mkDefault false; firefly-iii.enable = lib.mkDefault false;
tranga.enable = lib.mkDefault false;
}; };
}; };
virtualisation = { virtualisation = {

View File

@ -28,8 +28,8 @@ in
environmentFiles = [ config.sops.secrets.flame.path ]; environmentFiles = [ config.sops.secrets.flame.path ];
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
PUID = "1000"; PUID = toString config.users.users.jawz.uid;
PGID = "100"; PGID = toString config.users.groups.users.gid;
}; };
}; };
flame-nsfw = lib.mkIf cfgS.enable { flame-nsfw = lib.mkIf cfgS.enable {
@ -40,8 +40,8 @@ in
environmentFiles = [ config.sops.secrets.flame.path ]; environmentFiles = [ config.sops.secrets.flame.path ];
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
PUID = "1000"; PUID = toString config.users.users.jawz.uid;
PGID = "100"; PGID = toString config.users.groups.users.gid;
}; };
}; };
}; };

View File

@ -13,8 +13,8 @@ in
ports = [ "${toString cfg.port}:${toString cfg.port}" ]; ports = [ "${toString cfg.port}:${toString cfg.port}" ];
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
PUID = "1000"; PUID = toString config.users.users.jawz.uid;
PGID = "100"; PGID = toString config.users.groups.piracy.gid;
}; };
volumes = [ volumes = [
"/srv/pool/multimedia:/data" "/srv/pool/multimedia:/data"

View File

@ -15,8 +15,8 @@ in
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
MALOJA_TIMEZONE = "-6"; MALOJA_TIMEZONE = "-6";
PUID = "1000"; PUID = toString config.users.users.jawz.uid;
PGID = "100"; PGID = toString config.users.groups.users.gid;
MALOJA_DATA_DIRECTORY = "/mljdata"; MALOJA_DATA_DIRECTORY = "/mljdata";
MALOJA_SKIP_SETUP = "true"; MALOJA_SKIP_SETUP = "true";
}; };

View File

@ -17,6 +17,8 @@ in
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
YTDL_OPTIONS = ''{"cookiefile":"/cookies.txt"}''; YTDL_OPTIONS = ''{"cookiefile":"/cookies.txt"}'';
PUID = toString config.users.users.jawz.uid;
PGID = toString config.users.groups.piracy.gid;
}; };
}; };
services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy ( services.nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (

View File

@ -14,8 +14,8 @@ in
environmentFiles = [ config.sops.secrets.multi-scrobbler.path ]; environmentFiles = [ config.sops.secrets.multi-scrobbler.path ];
environment = { environment = {
TZ = config.my.timeZone; TZ = config.my.timeZone;
PUID = "1000"; PUID = toString config.users.users.jawz.uid;
PGID = "100"; PGID = toString config.users.groups.users.gid;
BASE_URL = cfg.url; BASE_URL = cfg.url;
DEEZER_REDIRECT_URI = "http://${config.my.ips.${cfg.hostName}}:${toString cfg.port}/deezer/callback"; DEEZER_REDIRECT_URI = "http://${config.my.ips.${cfg.hostName}}:${toString cfg.port}/deezer/callback";
MALOJA_URL = config.my.servers.maloja.url; MALOJA_URL = config.my.servers.maloja.url;

View File

@ -0,0 +1,33 @@
{
config,
lib,
...
}:
let
setup = import ./setup.nix { inherit lib config; };
cfg = config.my.servers.tranga;
in
{
options.my.servers.tranga = setup.mkOptions "tranga" "tranga" 9555;
config = {
networking.firewall.allowedTCPPorts = [ cfg.port ];
virtualisation.oci-containers.containers = lib.mkIf cfg.enable {
tranga-api = {
image = "glax/tranga-api:latest";
user = "${toString config.users.users.jawz.uid}:${toString config.users.groups.kavita.gid}";
environment.TZ = config.my.timeZone;
ports = [ "6531:6531" ];
volumes = [
"/srv/pool/multimedia/media/Library/Manga:/Manga"
"${config.my.containerData}/tranga-api:/usr/share/tranga-api"
];
};
tranga-website = {
image = "glax/tranga-website:latest";
ports = [ "${toString cfg.port}:80" ];
dependsOn = [ "tranga-api" ];
environment.TZ = config.my.timeZone;
};
};
};
}