feat(calibre): Pin image versions

This commit is contained in:
Tibo De Peuter 2025-06-26 11:50:52 +02:00
parent c294e159e2
commit d693c4a93b
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2

View file

@ -6,24 +6,28 @@ let
PUID = toString config.users.users.calibre.uid;
PGID = toString config.users.groups.media.gid;
books = "/srv/books";
calibre-config = "/srv/calibre-config";
calibre-web-config = "/srv/calibre-web-config";
networkName = "calibre";
in {
options.homelab.apps.calibre = {
enable = lib.mkEnableOption "Calibre (Desktop + Web)";
desktop = lib.mkEnableOption "Calibre Desktop (KasmVNC)";
web = lib.mkEnableOption "Calibre Web";
desktop.enable = lib.mkEnableOption "Calibre Desktop (KasmVNC)";
web.enable = lib.mkEnableOption "Calibre Web";
};
config = lib.mkMerge [
{
homelab.apps.calibre = lib.mkIf cfg.enable {
desktop = true;
web = true;
desktop.enable = true;
web.enable = true;
};
}
# Common
(lib.mkIf (cfg.desktop || cfg.web) {
(lib.mkIf (cfg.desktop.enable || cfg.web.enable) {
homelab = {
users.media.enable = true;
virtualisation.containers.enable = true;
@ -37,7 +41,7 @@ in {
shell = null;
};
fileSystems."/srv/books" = {
fileSystems."${books}" = {
device = "192.168.0.11:/mnt/SMALL/MEDIA/BOOKS";
fsType = "nfs";
options = [
@ -69,8 +73,8 @@ in {
})
# Calibre desktop
{
fileSystems."/srv/calibre-config" = {
(lib.mkIf cfg.desktop.enable {
fileSystems."${calibre-config}" = {
device = "192.168.0.11:/mnt/SMALL/CONFIG/CALIBRE";
fsType = "nfs";
options = [
@ -84,13 +88,15 @@ in {
];
};
virtualisation.oci-containers.containers.calibre = {
virtualisation.oci-containers.containers.calibre = let
innerPort = 8080;
in {
hostname = "calibre";
image = "lscr.io/linuxserver/calibre:latest";
image = "lscr.io/linuxserver/calibre:8.5.0";
autoStart = true;
ports = [
# Open ports if you don't use Traefik
"9480:8080" # Calibre desktop GUI
"9480:${toString innerPort}" # Calibre desktop GUI
#"9481:8181" # Calibre desktop GUI HTTPS
#"9581:8081" # Calibre webserver gui
];
@ -110,16 +116,21 @@ in {
#CLI_ARGS = "";
};
volumes = [
"/srv/calibre-config:/config"
"${calibre-config}:/config"
"/srv/books:/media/books"
"${books}:/media/books"
];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.calibre.rule" = "Host(`calibre.depeuter.dev`)";
"traefik.http.services.calibre.loadbalancer.server.port" = toString innerPort;
};
}
};
})
# Calibre Web
{
fileSystems."/srv/calibre-web-config" = {
(lib.mkIf cfg.web.enable {
fileSystems."${calibre-web-config}" = {
device = "192.168.0.11:/mnt/SMALL/CONFIG/CALIBRE-WEB";
fsType = "nfs";
options = [
@ -133,13 +144,15 @@ in {
];
};
virtualisation.oci-containers.containers.calibre-web = {
virtualisation.oci-containers.containers.calibre-web = let
innerPort = 8083;
in {
hostname = "calibre-web";
image = "lscr.io/linuxserver/calibre-web:latest";
image = "lscr.io/linuxserver/calibre-web:0.6.24";
autoStart = true;
ports = [
# Open ports if you don't use Traefik
"8083:8083" # Web UI
"8083:${toString innerPort}" # Web UI
];
extraOptions = [
"--network=${networkName}"
@ -156,11 +169,16 @@ in {
#OAUTHLIB_RELAX_TOKEN_SCOPE = "1";
};
volumes = [
"/srv/calibre-web-config:/config"
"${calibre-web-config}:/config"
"/srv/books:/media/books"
"${books}:/media/books"
];
labels = {
"traefik.enable" = "true";
"traefik.http.routers.calibre-web.rule" = "Host(`books.depeuter.dev`)";
"traefik.http.services.calibre-web.loadbalancer.server.port" = toString innerPort;
};
}
};
})
];
}