feat: refactor the modules/servers directory.
This commit is contained in:
parent
4e783c052b
commit
8b754d3a7e
69 changed files with 61 additions and 62 deletions
14
modules/servers/per-server/freyja/default.nix
Normal file
14
modules/servers/per-server/freyja/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{...}: let
|
||||
servicesDir = ./services;
|
||||
serviceFiles =
|
||||
builtins.filter
|
||||
(name: builtins.match "^.*\\.nix$" name != null)
|
||||
(builtins.attrNames (builtins.readDir servicesDir));
|
||||
hostModules = map (fn: import "${servicesDir}/${fn}") serviceFiles;
|
||||
in {
|
||||
imports =
|
||||
[
|
||||
../../common
|
||||
]
|
||||
++ hostModules;
|
||||
}
|
||||
39
modules/servers/per-server/freyja/services/immich.nix
Normal file
39
modules/servers/per-server/freyja/services/immich.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{...}: {
|
||||
services.immich = {
|
||||
enable = true;
|
||||
port = 2283;
|
||||
host = "127.0.0.1";
|
||||
accelerationDevices = ["/dev/dri/renderD128"];
|
||||
};
|
||||
|
||||
users.users.immich.extraGroups = ["video" "render"];
|
||||
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.immich.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:2283";
|
||||
}
|
||||
];
|
||||
|
||||
routers.immich = {
|
||||
rule = "Host(`immich.cronyakatsuki.xyz`)";
|
||||
tls = {
|
||||
certResolver = "porkbun";
|
||||
};
|
||||
service = "immich";
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresqlBackup = {
|
||||
enable = true;
|
||||
databases = [
|
||||
"immich"
|
||||
];
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
local.paths = ["/var/lib/immich" "/var/backup/postgresql"];
|
||||
server.paths = ["/var/lib/immich" "/var/backup/postgresql"];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue