nix-config/hosts/nixedo/modules/immich.nix
Oliver Davies a9cf2109a6 Move Homepage configuration into service
Move each service's Homepage Dashboard configuration into its own
module.

Based on
8928785060/homelab/services/homepage/default.nix.

See https://www.youtube.com/watch?v=f-x5cB6qCzA&t=1435s (What's on my
Home Server 2025 – NixOS Edition).
2025-04-30 11:58:59 +01:00

70 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = homelab.services.${service};
homelab = config.features.homelab;
service = "immich";
in
{
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {
default = "photos.${homelab.baseDomain}";
type = types.str;
};
homepage.name = mkOption {
default = "Immich";
type = types.str;
};
homepage.description = mkOption {
default = "Self-hosted photo and video management solution";
type = types.str;
};
homepage.icon = mkOption {
default = "immich";
type = types.str;
};
homepage.category = mkOption {
default = "Media";
type = types.str;
};
};
config = mkIf cfg.enable {
services = {
${service} = {
enable = true;
group = "media";
mediaLocation = "/mnt/media/${service}";
};
nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
useACMEHost = homelab.baseDomain;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.immich.port}";
proxyWebsockets = true;
recommendedProxySettings = true;
};
};
};
environment.systemPackages = with pkgs; [
immich-cli
immich-go
];
};
}