updates
This commit is contained in:
parent
d266a48b98
commit
07020f01c3
15 changed files with 321 additions and 86 deletions
|
@ -37,11 +37,6 @@ in {
|
|||
inputs.catppuccin.nixosModules.catppuccin
|
||||
];
|
||||
|
||||
services.v.dns = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
mode = "server";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./containers
|
||||
./immich.nix
|
||||
# ./vms.nix
|
||||
];
|
||||
|
||||
|
@ -30,7 +31,7 @@
|
|||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
|
||||
virtualisation.podman.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
# Additional packages
|
||||
environment.systemPackages = with pkgs; [ vault ];
|
||||
|
|
78
hosts/olympus/bastion/immich.nix
Normal file
78
hosts/olympus/bastion/immich.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
boot.kernel.sysctl = { "vm.overcommit_memory" = 1; };
|
||||
|
||||
virtualisation.oci-containers.backend = "docker";
|
||||
virtualisation.docker.autoPrune.enable = true;
|
||||
|
||||
|
||||
systemd.services.init-filerun-network-and-files = {
|
||||
description = "Create the network bridge for Immich.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
script =
|
||||
let
|
||||
dockercli = "${config.virtualisation.docker.package}/bin/docker";
|
||||
in
|
||||
''
|
||||
# immich-net network
|
||||
check=$(${dockercli} network ls | grep "immich-net" || true)
|
||||
if [ -z "$check" ]; then
|
||||
${dockercli} network create immich-net
|
||||
else
|
||||
echo "immich-net already exists in docker"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
immich = {
|
||||
autoStart = true;
|
||||
image = "ghcr.io/imagegenius/immich:latest";
|
||||
volumes = [
|
||||
"/mnt/backup/immich/config:/config"
|
||||
"/mnt/backup/immich/photos:/photos"
|
||||
"/mnt/backup/replicated/photos:/replicated"
|
||||
"/mnt/backup/immich/config/machine-learning:/config/machine-learning"
|
||||
];
|
||||
ports = [ "2283:8080" ];
|
||||
environment = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
TZ = "Europe/Amsterdam"; # Change this to your timezone
|
||||
DB_HOSTNAME = "postgres14";
|
||||
DB_USERNAME = "postgres";
|
||||
DB_PASSWORD = "postgres";
|
||||
DB_DATABASE_NAME = "immich";
|
||||
REDIS_HOSTNAME = "redis";
|
||||
};
|
||||
extraOptions = [
|
||||
"--network=immich-net"
|
||||
"--pull=always"
|
||||
# "--gpus=all"
|
||||
];
|
||||
};
|
||||
|
||||
redis = {
|
||||
autoStart = true;
|
||||
image = "redis";
|
||||
ports = [ "6379:6379" ];
|
||||
extraOptions = [ "--network=immich-net" ];
|
||||
};
|
||||
|
||||
postgres14 = {
|
||||
autoStart = true;
|
||||
image = "tensorchord/pgvecto-rs:pg14-v0.2.0";
|
||||
ports = [ "5432:5432" ];
|
||||
volumes = [ "pgdata:/var/lib/postgresql/data" ];
|
||||
environment = {
|
||||
POSTGRES_USER = "postgres";
|
||||
POSTGRES_PASSWORD = "postgres";
|
||||
POSTGRES_DB = "immich";
|
||||
};
|
||||
extraOptions = [ "--network=immich-net" ];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue