Skip to content

Commit

Permalink
tiny1: add ebookbuddy
Browse files Browse the repository at this point in the history
  • Loading branch information
hyshka committed Dec 1, 2024
1 parent c8f448d commit e1ee53b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hosts/tiny1/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ grafana-adminPass: ENC[AES256_GCM,data:Zbs2mwq75cf5k4la9V1AVYdHoDT4rTQ3,iv:u8kjJ
paperless-passwordFile: ENC[AES256_GCM,data:qYWdvXXeao3kZkVmWDAfdXHYSFro3FEI,iv:l9kTEiM3iZQXnFpuyhjOlJgA8uiB2pp8E5HtWUpWgec=,tag:9We20OmOegs+OVC9mybncA==,type:str]
adguard-passwordFile: ENC[AES256_GCM,data:+fQELnKBx5WRx8zfQUsFvs4mnXT48xo+,iv:zXLWQrATSOQCszztjRXsKIgtgQLvZWps6VffreA0290=,tag:n6bDP7NlRUNl0Vokvp8frA==,type:str]
immich-secretsFile: ENC[AES256_GCM,data:UB1cnC6BkYBOgifZLlcEHYyzWsberD75wu6U26KsQVQLI/SNmo/EapBJXPbOssfed1kO3bIfxh/Y5KnYhTrK+LbF96GNONkCTgzAkYU=,iv:UFtKfuSRHwwczOsprXay15w+2aVagcl9ekTfIu9o+qU=,tag:4CbBp2ChjHguhzyuQ9QMfQ==,type:str]
ebookbuddy-envFile: ENC[AES256_GCM,data:6waeYSSdL+eC2rO7rYFT7RCVEnpfktoNz82T6Bo42d49CIMwLs3MKIeSzvc2t/Z1wQ==,iv:5SiK5SLfV/bZXncKaTcqCGX/7M/RoFaWN/cA97Zi76k=,tag:65/u0PAjMjFFK8Zi1XUpXg==,type:str]
sops:
kms: []
gcp_kms: []
Expand All @@ -30,8 +31,8 @@ sops:
WDBrSzgyN2k0UUttWHMxNmlDT2ZCSDgKH14m52P/6PVxOwJTGwSjZdzqh3r2zlER
/5EM3g7kFjUgRd+4Z5GnBMZp0LdN9Li4QKoz9diDJyNpVGNM4HGPxw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-23T21:27:58Z"
mac: ENC[AES256_GCM,data:9ILVE84uhVOIl0reKsIvf9O9VPFZeRwO+xm9DeLa/wLYlZtSy+MCOmvBA4Ol/1ooC2uMWMBkxSq/CxaoKLX5aWHfIW/9j6cHU+8+X2Osg0SdQ/mKWNP3nZmhha4VykzxWrj/W7dunhqWyREvn6MosvG6hszPN5knc8MV5EWswa0=,iv:4nptH3heLUhCNaT4MIxRsEYHSUt9VzG4yrVWRQ0tico=,tag:187/o97vRW1kcuFCRPBovg==,type:str]
lastmodified: "2024-12-01T22:37:26Z"
mac: ENC[AES256_GCM,data:yjp8A8Tsav3pOrJumliR3A4d1ojvjWE2fdnLSCN6Z4t6K9tC56xaq/eyQeeFcxH3LCbSJkpTcmJvjQx7/Jr9T7o0SWJnx4G4pc6kno9vXk1hoygPMcoXllVSZO0Ez+wdRUULaTmEuBOmUL0IJwZXmLxdkLZ8a7mU5cphJymYR4A=,iv:Y/m+lbYUbeVOYj5zO3wplQvOJDB5e00CLQMYwPV+1M8=,tag:v7lSUWygrobIysjv1xdyyA==,type:str]
pgp:
- created_at: "2023-09-16T19:41:40Z"
enc: |
Expand Down
5 changes: 5 additions & 0 deletions hosts/tiny1/services/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
reverse_proxy http://127.0.0.1:8787
}
@ebookbuddy host ebookbuddy.home.hyshka.com
handle @ebookbuddy {
reverse_proxy http://127.0.0.1:5000
}
@sonarr host sonarr.home.hyshka.com
handle @sonarr {
reverse_proxy http://127.0.0.1:8989
Expand Down
5 changes: 5 additions & 0 deletions hosts/tiny1/services/media/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
uid = 13010;
group = "mediacenter";
};
ebookbuddy = {
isSystemUser = true;
uid = 13011;
group = "mediacenter";
};
};
};
}
68 changes: 68 additions & 0 deletions hosts/tiny1/services/media/docker-compose.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
pkgs,
lib,
config,
...
}: {
# Runtime
Expand All @@ -11,6 +12,13 @@
#};
#virtualisation.oci-containers.backend = "docker";

sops.secrets = {
ebookbuddy-envFile = {
owner = "ebookbuddy";
group = "mediacenter";
};
};

# Containers
virtualisation.oci-containers.containers."jellyfin" = {
image = "lscr.io/linuxserver/jellyfin:latest";
Expand Down Expand Up @@ -430,6 +438,66 @@
];
};

systemd.tmpfiles.settings."ebookbuddy" = {
"/home/hyshka/media/ebookbuddy-config" = {
d = {
group = "mediacenter";
mode = "0755";
user = "ebookbuddy";
};
};
};
virtualisation.oci-containers.containers."ebookbuddy" = {
image = "thewicklowwolf/ebookbuddy:latest";
environment = {
"GID" = "13000";
"UID" = "13010";
"readarr_address" = "readarr:8787";
"root_folder_path" = "/data/media/books";
};
environmentFiles = [
# contains:
# - readarr_api_key
# TODO: is this required?
# - google_books_api_key
config.sops.secrets.ebookbuddy-envFile.path
];
volumes = [
"/etc/localtime:/etc/localtime:ro"
"/home/hyshka/media/ebookbuddy-config:/config:rw"
"/mnt/storage/mediacenter:/data:rw"
];
ports = [
"5000:5000/tcp"
];
log-driver = "journald";
extraOptions = [
"--add-host=host.docker.internal:host-gateway"
"--network-alias=ebookbuddy"
"--network=media_default"
];
};
systemd.services."docker-ebookbuddy" = {
serviceConfig = {
Restart = lib.mkOverride 90 "always";
RestartMaxDelaySec = lib.mkOverride 90 "1m";
RestartSec = lib.mkOverride 90 "100ms";
RestartSteps = lib.mkOverride 90 9;
};
after = [
"docker-network-media_default.service"
];
requires = [
"docker-network-media_default.service"
];
partOf = [
"docker-compose-media-root.target"
];
wantedBy = [
"docker-compose-media-root.target"
];
};

# Networks
systemd.services."docker-network-media_default" = {
path = [pkgs.docker];
Expand Down

0 comments on commit e1ee53b

Please sign in to comment.