chore:update immich

fix: agenix keygrip
This commit is contained in:
Patrick 2024-06-30 22:27:19 +02:00
parent bb6e22da48
commit 7167acf43d
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
8 changed files with 28 additions and 55 deletions

View file

@ -36,6 +36,7 @@ in {
config = { config = {
common.default = [ common.default = [
"gtk" "gtk"
"hyprland"
]; ];
sway.default = [ sway.default = [
"wlr" "wlr"

View file

@ -14,7 +14,6 @@ lib.optionalAttrs (!minimal) {
enable = true; enable = true;
xdgOpenUsePortal = true; xdgOpenUsePortal = true;
config.common = { config.common = {
default = ["gtk" "hyprland"];
"org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"];
"org.freedesktop.impl.portal.ScreenCast" = ["hyprland"]; "org.freedesktop.impl.portal.ScreenCast" = ["hyprland"];
"org.freedesktop.impl.portal.Screenshot" = ["hyprland"]; "org.freedesktop.impl.portal.Screenshot" = ["hyprland"];

View file

@ -5,11 +5,10 @@
config, config,
... ...
}: let }: let
version = "v1.105.1"; version = "v1.106.4";
immichDomain = "immich.${config.secrets.secrets.global.domains.web}"; immichDomain = "immich.${config.secrets.secrets.global.domains.web}";
ipImmichMachineLearning = "10.89.0.10"; ipImmichMachineLearning = "10.89.0.10";
ipImmichMicroservices = "10.89.0.11";
ipImmichPostgres = "10.89.0.12"; ipImmichPostgres = "10.89.0.12";
ipImmichRedis = "10.89.0.13"; ipImmichRedis = "10.89.0.13";
ipImmichServer = "10.89.0.14"; ipImmichServer = "10.89.0.14";
@ -70,9 +69,7 @@
}; };
url = "http://${ipImmichMachineLearning}:3003"; url = "http://${ipImmichMachineLearning}:3003";
}; };
# XXX: Immich's oauth cannot use PKCE and uses legacy crypto so we need to run: # XXX: Immich's oauth cannot use PKCE and uses legacy crypto so we need to enable legacy crypto
# kanidm system oauth2 warning-insecure-client-disable-pkce immich
# kanidm system oauth2 warning-enable-legacy-crypto immich
oauth = rec { oauth = rec {
enabled = true; enabled = true;
autoLaunch = false; autoLaunch = false;
@ -160,6 +157,12 @@ in {
age.secrets.immichHetznerSsh = { age.secrets.immichHetznerSsh = {
generator.script = "ssh-ed25519"; generator.script = "ssh-ed25519";
}; };
environment.persistence."/state".directories = [
{
directory = "/var/lib/containers";
mode = "0755";
}
];
services.restic.backups = { services.restic.backups = {
main = { main = {
user = "root"; user = "root";
@ -272,36 +275,6 @@ in {
}; };
systemd.services."podman-immich_machine_learning" = serviceConfig; systemd.services."podman-immich_machine_learning" = serviceConfig;
virtualisation.oci-containers.containers."immich_microservices" = {
image = "ghcr.io/immich-app/immich-server:${version}";
inherit environment;
volumes = [
"${processedConfigFile}:${environment.IMMICH_CONFIG_FILE}:ro"
"/etc/localtime:/etc/localtime:ro"
"${upload_folder}:/usr/src/app/upload:rw"
"${environment.DB_PASSWORD_FILE}:${environment.DB_PASSWORD_FILE}:ro"
];
cmd = ["start.sh" "microservices"];
dependsOn = [
"immich_postgres"
"immich_redis"
];
log-driver = "journald";
extraOptions = [
"--network-alias=immich-microservices"
"--network=immich-default"
"--ip=${ipImmichMicroservices}"
];
};
systemd.services."podman-immich_microservices" =
serviceConfig
// {
unitConfig.UpheldBy = [
"podman-immich_postgres.service"
"podman-immich_redis.service"
];
};
virtualisation.oci-containers.containers."immich_postgres" = { virtualisation.oci-containers.containers."immich_postgres" = {
image = "tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0"; image = "tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
environment = { environment = {
@ -343,7 +316,6 @@ in {
ports = [ ports = [
"3000:3001/tcp" "3000:3001/tcp"
]; ];
cmd = ["start.sh" "immich"];
dependsOn = [ dependsOn = [
"immich_postgres" "immich_postgres"
"immich_redis" "immich_redis"

View file

@ -116,6 +116,7 @@ in {
originUrl = "https://immich.${config.secrets.secrets.global.domains.web}/"; originUrl = "https://immich.${config.secrets.secrets.global.domains.web}/";
basicSecretFile = config.age.secrets.oauth2-immich.path; basicSecretFile = config.age.secrets.oauth2-immich.path;
allowInsecureClientDisablePkce = true; allowInsecureClientDisablePkce = true;
enableLegacyCrypto = true;
scopeMaps."immich.access" = ["openid" "email" "profile"]; scopeMaps."immich.access" = ["openid" "email" "profile"];
preferShortUsername = true; preferShortUsername = true;
}; };

View file

@ -1,9 +1,4 @@
{ {pkgs, ...}: {
pkgs,
lib,
nixosConfig,
...
}: {
services.gpg-agent = { services.gpg-agent = {
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
@ -76,10 +71,4 @@
#list-options show-unusable-subkeys #list-options show-unusable-subkeys
}; };
}; };
# Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status`
# before being able to use the yubikey.
home.activation.installKeygrips = lib.hm.dag.entryAfter ["writeBoundary"] ''
run mkdir -p "$HOME/.gnupg/private-keys-v1.d"
run ${lib.getExe pkgs.gnutar} xvf ${lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path} -C "$HOME/.gnupg/private-keys-v1.d/"
'';
} }

View file

@ -48,6 +48,11 @@ lib.optionalAttrs (!minimal) {
}; };
programs.dconf.enable = true; programs.dconf.enable = true;
age.secrets."my-gpg-yubikey-keygrip.tar" = {
rekeyFile = ./secrets/gpg-keygrip.tar.age;
group = "patrick";
mode = "640";
};
home-manager.users.patrick = { home-manager.users.patrick = {
imports = imports =

View file

@ -1,4 +1,9 @@
{pkgs, ...}: { {
pkgs,
lib,
nixosConfig,
...
}: {
images.enable = true; images.enable = true;
home = { home = {
packages = with pkgs; [ packages = with pkgs; [
@ -31,4 +36,10 @@
via via
]; ];
}; };
# Make sure the keygrips exist, otherwise we'd need to run `gpg --card-status`
# before being able to use the yubikey.
home.activation.installKeygrips = lib.hm.dag.entryAfter ["writeBoundary"] ''
run mkdir -p "$HOME/.gnupg/private-keys-v1.d"
run ${lib.getExe pkgs.gnutar} xvf ${lib.escapeShellArg nixosConfig.age.secrets."my-gpg-yubikey-keygrip.tar".path} -C "$HOME/.gnupg/private-keys-v1.d/"
'';
} }

View file

@ -19,9 +19,4 @@
home-manager.users.root.imports = lib.lists.optionals (!minimal) [ home-manager.users.root.imports = lib.lists.optionals (!minimal) [
../common ../common
]; ];
age.secrets."my-gpg-yubikey-keygrip.tar" = {
rekeyFile = ./secrets/gpg-keygrip.tar.age;
group = "patrick";
mode = "640";
};
} }