This commit is contained in:
@@ -59,25 +59,25 @@ in
|
||||
|
||||
host = lib.mkOption {
|
||||
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.";
|
||||
};
|
||||
|
||||
username = lib.mkOption {
|
||||
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*";
|
||||
default = "u666713";
|
||||
default = "u666713-sub1";
|
||||
description = "Storage Box SMB username.";
|
||||
};
|
||||
|
||||
share = lib.mkOption {
|
||||
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_-]*";
|
||||
default = "backup";
|
||||
default = "u666713-sub1";
|
||||
description = "SMB share exported by Storage Box.";
|
||||
};
|
||||
|
||||
subdirectory = lib.mkOption {
|
||||
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_./-]*";
|
||||
default = "immich";
|
||||
type = lib.types.nullOr (lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9_./-]*");
|
||||
default = null;
|
||||
description = "Directory within the SMB share used by Immich.";
|
||||
};
|
||||
|
||||
@@ -157,8 +157,8 @@ in
|
||||
"gid=${config.services.immich.group}"
|
||||
"file_mode=0660"
|
||||
"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 [
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
sandboxConfigLines = lib.mapAttrsToList (
|
||||
name: value: "${name} = ${luaValue value},"
|
||||
) cfg.sandboxProperties;
|
||||
zomboidDir = "${cfg.dataDir}/Zomboid";
|
||||
adminPasswordFile = "${cfg.dataDir}/admin-password";
|
||||
startScript = pkgs.writeShellScript "project-zomboid-start" ''
|
||||
admin_password=$(${pkgs.coreutils}/bin/cat ${lib.escapeShellArg adminPasswordFile})
|
||||
@@ -165,14 +166,14 @@ in {
|
||||
's/"-Xmx[0-9]+[mMgG]"/"-Xmx${cfg.memory}"/' \
|
||||
${lib.escapeShellArg "${cfg.installDir}/ProjectZomboid64.json"}
|
||||
${pkgs.coreutils}/bin/install -d -m 0750 \
|
||||
${lib.escapeShellArg "${cfg.dataDir}/Server"}
|
||||
${lib.escapeShellArg "${zomboidDir}/Server"}
|
||||
{
|
||||
${lib.concatMapStringsSep "\n " (line:
|
||||
"${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};"
|
||||
) configLines}
|
||||
${lib.optionalString (cfg.serverPropertiesFile != null)
|
||||
"${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 != { }) ''
|
||||
{
|
||||
${pkgs.coreutils}/bin/printf '%s\n' 'SandboxVars = {';
|
||||
@@ -180,7 +181,7 @@ in {
|
||||
"${pkgs.coreutils}/bin/printf '%s\\n' ${lib.escapeShellArg line};"
|
||||
) sandboxConfigLines}
|
||||
${pkgs.coreutils}/bin/printf '%s\n' '};';
|
||||
} > ${lib.escapeShellArg "${cfg.dataDir}/Server/${cfg.serverName}_SandboxVars.lua"}
|
||||
} > ${lib.escapeShellArg "${zomboidDir}/Server/${cfg.serverName}_SandboxVars.lua"}
|
||||
''}
|
||||
'';
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ in {
|
||||
(import ./containers.nix { inherit flake self inputs; })
|
||||
./experimental-sshd.nix
|
||||
(import ./ente.nix { inherit domain; })
|
||||
(import ./immich.nix { inherit domain; })
|
||||
(import ./mechabellum.nix { inherit flake self inputs domain; })
|
||||
(import (./. + "/sentinèlla.nix") { inherit flake self inputs domain; })
|
||||
];
|
||||
@@ -231,6 +232,7 @@ in {
|
||||
key = "init-postgresql";
|
||||
};
|
||||
"atticd/environment" = {};
|
||||
"immich/storage-box" = {};
|
||||
"wg-bfs/private-key" = {};
|
||||
"gitea-runner/org-registration-token" = {
|
||||
sopsFile = flake + "/sus/gitea-runners.yaml";
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user