mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
pruned
This commit is contained in:
commit
072951659a
114 changed files with 6922 additions and 0 deletions
57
system/machines/server/modules/immich/default.nix
Normal file
57
system/machines/server/modules/immich/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.system.immich;
|
||||
nginx = config.modules.system.nginx;
|
||||
domain = "ramos.codes";
|
||||
port = 2283;
|
||||
|
||||
in
|
||||
{
|
||||
options.modules.system.immich = {
|
||||
enable = mkEnableOption "Immich Photo Server";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Bind mount from /data
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /data/immich 0750 immich immich -"
|
||||
"d /data/postgresql 0750 postgres postgres -"
|
||||
];
|
||||
|
||||
fileSystems."/var/lib/immich" = {
|
||||
device = "/data/immich";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/postgresql" = {
|
||||
device = "/data/postgresql";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
services.immich = {
|
||||
enable = true;
|
||||
port = port;
|
||||
host = "127.0.0.1";
|
||||
mediaLocation = "/var/lib/immich";
|
||||
machine-learning.enable = false;
|
||||
};
|
||||
|
||||
modules.system.backup.paths = [
|
||||
"/var/lib/immich"
|
||||
"/var/lib/postgresql"
|
||||
];
|
||||
|
||||
services.nginx.virtualHosts."photos.${domain}" = mkIf nginx.enable {
|
||||
useACMEHost = domain;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue