feat: configure immich
runner nix smoke / nix label and flake smoke (push) Failing after 25s

This commit is contained in:
2026-09-12 22:21:33 +00:00
parent 66a502b1dd
commit 1e973e7b33
5 changed files with 33 additions and 12 deletions
+7 -7
View File
@@ -59,25 +59,25 @@ in
host = lib.mkOption { host = lib.mkOption {
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9.-]*"; type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9.-]*";
default = "u666713.your-storagebox.de"; default = "u666713-sub1.your-storagebox.de";
description = "Hetzner Storage Box SMB hostname."; description = "Hetzner Storage Box SMB hostname.";
}; };
username = lib.mkOption { username = lib.mkOption {
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*"; type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*";
default = "u666713"; default = "u666713-sub1";
description = "Storage Box SMB username."; description = "Storage Box SMB username.";
}; };
share = lib.mkOption { share = lib.mkOption {
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*"; type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*";
default = "backup"; default = "u666713-sub1";
description = "SMB share exported by Storage Box."; description = "SMB share exported by Storage Box.";
}; };
subdirectory = lib.mkOption { subdirectory = lib.mkOption {
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_./-]*"; type = lib.types.nullOr (lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_./-]*");
default = "immich"; default = null;
description = "Directory within the SMB share used by Immich."; description = "Directory within the SMB share used by Immich.";
}; };
@@ -157,8 +157,8 @@ in
"gid=${config.services.immich.group}" "gid=${config.services.immich.group}"
"file_mode=0660" "file_mode=0660"
"dir_mode=0770" "dir_mode=0770"
"prefixpath=${cfg.storageBox.subdirectory}" ] ++ lib.optional (cfg.storageBox.subdirectory != null)
]; "prefixpath=${cfg.storageBox.subdirectory}";
}; };
systemd.services.immich-server.serviceConfig.RequiresMountsFor = lib.mkIf cfg.storageBox.enable [ systemd.services.immich-server.serviceConfig.RequiresMountsFor = lib.mkIf cfg.storageBox.enable [
@@ -26,6 +26,7 @@
sandboxConfigLines = lib.mapAttrsToList ( sandboxConfigLines = lib.mapAttrsToList (
name: value: "${name} = ${luaValue value}," name: value: "${name} = ${luaValue value},"
) cfg.sandboxProperties; ) cfg.sandboxProperties;
zomboidDir = "${cfg.dataDir}/Zomboid";
adminPasswordFile = "${cfg.dataDir}/admin-password"; adminPasswordFile = "${cfg.dataDir}/admin-password";
startScript = pkgs.writeShellScript "project-zomboid-start" '' startScript = pkgs.writeShellScript "project-zomboid-start" ''
admin_password=$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg adminPasswordFile}) admin_password=$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg adminPasswordFile})
@@ -165,14 +166,14 @@ in {
's/"-Xmx[0-9]+[mMgG]"/"-Xmx${cfg.memory}"/' \ 's/"-Xmx[0-9]+[mMgG]"/"-Xmx${cfg.memory}"/' \
${lib.escapeShellArg "${cfg.installDir}/ProjectZomboid64.json"} ${lib.escapeShellArg "${cfg.installDir}/ProjectZomboid64.json"}
${pkgs.coreutils}/bin/install -d -m 0750 \ ${pkgs.coreutils}/bin/install -d -m 0750 \
${lib.escapeShellArg "${cfg.dataDir}/Server"} ${lib.escapeShellArg "${zomboidDir}/Server"}
{ {
${lib.concatMapStringsSep "\n " (line: ${lib.concatMapStringsSep "\n " (line:
"${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};" "${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};"
) configLines} ) configLines}
${lib.optionalString (cfg.serverPropertiesFile != null) ${lib.optionalString (cfg.serverPropertiesFile != null)
"${pkgs.coreutils}/bin/cat ${lib.escapeShellArg cfg.serverPropertiesFile};"} "${pkgs.coreutils}/bin/cat ${lib.escapeShellArg cfg.serverPropertiesFile};"}
} > ${lib.escapeShellArg "${cfg.dataDir}/Server/${cfg.serverName}.ini"} } > ${lib.escapeShellArg "${zomboidDir}/Server/${cfg.serverName}.ini"}
${lib.optionalString (cfg.sandboxProperties != { }) '' ${lib.optionalString (cfg.sandboxProperties != { }) ''
{ {
${pkgs.coreutils}/bin/printf '%s\n' 'SandboxVars = {'; ${pkgs.coreutils}/bin/printf '%s\n' 'SandboxVars = {';
@@ -180,7 +181,7 @@ in {
"${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};" "${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};"
) sandboxConfigLines} ) sandboxConfigLines}
${pkgs.coreutils}/bin/printf '%s\n' '};'; ${pkgs.coreutils}/bin/printf '%s\n' '};';
} > ${lib.escapeShellArg "${cfg.dataDir}/Server/${cfg.serverName}_SandboxVars.lua"} } > ${lib.escapeShellArg "${zomboidDir}/Server/${cfg.serverName}_SandboxVars.lua"}
''} ''}
''; '';
+2
View File
@@ -63,6 +63,7 @@ in {
(import ./containers.nix { inherit flake self inputs; }) (import ./containers.nix { inherit flake self inputs; })
./experimental-sshd.nix ./experimental-sshd.nix
(import ./ente.nix { inherit domain; }) (import ./ente.nix { inherit domain; })
(import ./immich.nix { inherit domain; })
(import ./mechabellum.nix { inherit flake self inputs domain; }) (import ./mechabellum.nix { inherit flake self inputs domain; })
(import (./. + "/sentinèlla.nix") { inherit flake self inputs domain; }) (import (./. + "/sentinèlla.nix") { inherit flake self inputs domain; })
]; ];
@@ -231,6 +232,7 @@ in {
key = "init-postgresql"; key = "init-postgresql";
}; };
"atticd/environment" = {}; "atticd/environment" = {};
"immich/storage-box" = {};
"wg-bfs/private-key" = {}; "wg-bfs/private-key" = {};
"gitea-runner/org-registration-token" = { "gitea-runner/org-registration-token" = {
sopsFile = flake + "/sus/gitea-runners.yaml"; sopsFile = flake + "/sus/gitea-runners.yaml";
+16
View File
@@ -0,0 +1,16 @@
{ domain, ... }:
{
config,
...
}:
{
hectic.services.immich = {
enable = true;
domain = "immich.${domain}";
storageBox = {
enable = true;
credentialsFile = config.sops.secrets."immich/storage-box".path;
};
};
}
+4 -2
View File
@@ -1,3 +1,5 @@
immich:
storage-box: ENC[AES256_GCM,data:eFNo4YaxJL25tM2icmwT+xrgkTybm20bKxCdc9JjG3ijmjM7FeOw/oQ4,iv:Y7GE+IfgQpz3Q4EvXWlPJnrFm08DkUT6qeDOr/nGFEM=,tag:3gtZA0v5dwGUlE34Ijz4Rg==,type:str]
mailserver: mailserver:
security: security:
hashedPassword: ENC[AES256_GCM,data:Z03x7tWHIhlRPaRZSrukyYOKhs6LdasZhZdizHdhlaJp2bywQZXKBaDABj2ab4rhwAPCHWhSiBjz35zV,iv:Z3hLC/A4YLVQkflr4cg9/wkKzo/RUdnLTwYC7ZhS0Hk=,tag:mSF/mbzH7iG6PwzyEsmyGg==,type:str] hashedPassword: ENC[AES256_GCM,data:Z03x7tWHIhlRPaRZSrukyYOKhs6LdasZhZdizHdhlaJp2bywQZXKBaDABj2ab4rhwAPCHWhSiBjz35zV,iv:Z3hLC/A4YLVQkflr4cg9/wkKzo/RUdnLTwYC7ZhS0Hk=,tag:mSF/mbzH7iG6PwzyEsmyGg==,type:str]
@@ -81,7 +83,7 @@ sops:
Yk43ZmlTc09aNFV1VjdjN2RWQlFWTDQKcYSvA2lHP8GS0lkYY19Tm8RXmFHQX5Ck Yk43ZmlTc09aNFV1VjdjN2RWQlFWTDQKcYSvA2lHP8GS0lkYY19Tm8RXmFHQX5Ck
qV2Fn22Fic4M5FVKDEMfaO6WmeXgki9a8dGeO9LlC+Phf16SOq7eLw== qV2Fn22Fic4M5FVKDEMfaO6WmeXgki9a8dGeO9LlC+Phf16SOq7eLw==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2026-06-06T12:32:43Z" lastmodified: "2026-09-12T22:13:26Z"
mac: ENC[AES256_GCM,data:cmATu3qAaY7B74NvbejyMQMflh3akc0eLV+yal0NrTSE3rMd8rXYiAv1d2j/RxNd2ZLvnj5g6PFBP3O7v0JuYjKcNOvImz7SR2RRIaEWfT9Nl7XGtpTn5EpIi5KiL3unsqZTjvGrRywyLVfg0bxdKxX7RLnrBInX/zPVvMRNCL0=,iv:YpQdmsloPs3LrXA2FodziBCfxNfKrImPSe7TLNO1KH0=,tag:0By4hddfHl/0a5souDsJBw==,type:str] mac: ENC[AES256_GCM,data:NdCP9Vm8AQej0u3/6evlskRV4B5+QA3gNegQ5s5laoX+SwJNXnrJtAwZBKCWEZQKMb32qI+YVgnIJfn+HaJCkeaDqmc2I8d3DobiucraZypXh2VtWXGe4vCwzbhoc8KDb1eSNKt2e5CIzaR89BQYuwIHdngTSlzJ/qdc02qR1tA=,iv:VQcQoXpMlVCPZkREL35dwKSCCDTbAscDQk01mn9jht0=,tag:oaJTl+uj33/8WVoTv/j7Nw==,type:str]
unencrypted_suffix: _unencrypted unencrypted_suffix: _unencrypted
version: 3.10.2 version: 3.10.2