feat: switch immich to modules/

This commit is contained in:
Giulio De Pasquale 2025-04-26 14:51:16 +01:00
parent ddc4d884b7
commit d40f064925
5 changed files with 57 additions and 78 deletions

View File

@ -24,17 +24,12 @@ in
./matrix.nix
./fail2ban.nix
./dns.nix
# ./minecraft.nix
./prowlarr.nix
./redlib.nix
# ./invidious.nix
./jellyfin.nix
# ./docker.nix
./tailscale.nix
./headscale.nix
./llm.nix
# ./photoprism.nix
./immich.nix
./sunshine.nix
./jellyseer.nix
./postgres.nix
@ -156,9 +151,16 @@ in
smartd.enable = true;
};
pepe.services.gitea = {
enable = true;
domain = "git.giugl.io";
pepe.services = {
gitea = {
enable = true;
domain = "git.giugl.io";
};
immich = {
enable = true;
domain = "photos.giugl.io";
package = pkgs.unstablePkgs.immich;
};
};
}

View File

@ -1,34 +0,0 @@
{ config, lib, ... }:
let
domain = "git.giugl.io";
in
{
architect = {
firewall.openTCP = [ config.services.gitea.settings.server.SSH_PORT ];
vhost.${domain} = {
dnsInterfaces = [ "lan" "tailscale" ];
locations."/" = {
port = config.services.gitea.settings.server.HTTP_PORT;
allowWAN = true;
};
};
};
services.gitea = {
enable = true;
database.type = "sqlite3";
appName = "Gitea";
# https://github.com/NixOS/nixpkgs/issues/235442#issuecomment-1574329453
lfs.enable = true;
settings = {
server = {
DOMAIN = domain;
ROOT_URL = "https://${domain}";
SSH_PORT = 22;
HTTP_PORT = 3001;
};
openid.enable_openid_signin = true;
};
};
}

View File

@ -1,35 +0,0 @@
{ config, pkgs, lib, ... }:
let
domain = "photos.giugl.io";
in
{
# disabledModules = [ "services/web-apps/immich.nix" ];
services = {
immich = {
enable = true;
package = pkgs.unstablePkgs.immich;
# accelerationDevices = null;
# settings.server.externalDomain = "https://${domain}";
};
};
architect.vhost.${domain} = {
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
host = "[::1]";
port = config.services.immich.port;
allowLan = true;
allowWAN = true;
allow = [ config.architect.networks."tailscale".net ];
proxyWebsockets = true;
extraConfig = ''
# allow large file uploads
client_max_body_size 50000M;
'';
};
};
users.users.immich.extraGroups = [ "video" "render" "media" "nextcloud" ];
}

View File

@ -1,3 +1,6 @@
{ ... }: {
imports = [ ./gitea];
imports = [
./gitea
./immich
];
}

View File

@ -0,0 +1,43 @@
{ config, pkgs, lib, ... }:
let
cfg = config.pepe.services.immich;
in
{
options.pepe.services.immich = with lib; {
enable = mkEnableOption "Enable immich";
package = mkPackageOption pkgs "immich" { };
domain = mkOption {
type = types.str;
default = null;
};
};
config = lib.mkIf cfg.enable {
services = {
immich = {
enable = true;
package = cfg.package;
# accelerationDevices = null;
};
};
architect.vhost.${cfg.domain} = {
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
host = "[::1]";
port = config.services.immich.port;
allowLan = true;
allowWAN = true;
allow = [ config.architect.networks."tailscale".net ];
proxyWebsockets = true;
extraConfig = ''
# allow large file uploads
client_max_body_size 50000M;
'';
};
};
users.users.immich.extraGroups = [ "video" "render" "media" "nextcloud" ];
};
}