infrastructure/nixos/hosts/hades/immich/configuration.nix
Vivian 66cc0c8f34
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
temp disable immich
2023-05-24 13:58:40 +02:00

69 lines
2 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, config, ... }:
let
# https://github.com/immich-app/immich/releases
# version = "1.55.1";
dataDir = "/var/lib/immich";
in {
imports = [ ];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
# Additional packages
environment.systemPackages = with pkgs; [ ];
# TODO: https://github.com/suderman/nixos/tree/main/modules/nixos/immich
fileSystems."/mnt/storage" = {
device = "storage:/mnt/storage";
fsType = "nfs";
};
# Unused uid/gid snagged from this list:
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/ids.nix
ids.uids.immich = 911;
ids.gids.immich = 911;
users.users.immich = {
isSystemUser = true;
group = "photos";
description = "Immich daemon user";
home = dataDir;
uid = config.ids.uids.immich;
};
users.groups.immich = { gid = config.ids.gids.immich; };
# Postgres database configuration
services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
ensureUsers = [{
name = "immich";
ensurePermissions = { "DATABASE immich" = "ALL PRIVILEGES"; };
}];
ensureDatabases = [ "immich" ];
# Allow connections from any docker IP addresses
authentication = ''
host immich immich 172.16.0.0/12 md5
host all all 127.0.0.1/32 ident
'';
};
# Allow docker containers to connect
networking.firewall.allowedTCPPorts = [ config.services.postgresql.port ];
}