Compare commits
7 commits
9a153603ee
...
eeccafbe82
Author | SHA1 | Date | |
---|---|---|---|
eeccafbe82 | |||
6c2b071db1 | |||
fb06a36d6a | |||
02eacb37e5 | |||
9a7a745cd6 | |||
59d9b333d1 | |||
1b13296783 |
3 changed files with 40 additions and 13 deletions
|
@ -62,11 +62,14 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# NOTE: for now, we use internal ports
|
|
||||||
# TODO: switch to unixsockets if supported
|
# TODO: switch to unixsockets if supported
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
clientMaxBodySize = "500m";
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -34,11 +34,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728334376,
|
"lastModified": 1730190761,
|
||||||
"narHash": "sha256-CTKEKPzD/j8FK6H4DO3EjyixZd3HHvgAgfnCwpGFP5c=",
|
"narHash": "sha256-o5m5WzvY6cGIDupuOvjgNSS8AN6yP2iI9MtUC6q/uos=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "d39ee334984fcdae6244f5a8e6ab857479cbaefe",
|
"rev": "3979285062d6781525cded0f6c4ff92e71376b55",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -83,11 +83,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728241625,
|
"lastModified": 1730531603,
|
||||||
"narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=",
|
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1",
|
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -1,28 +1,52 @@
|
||||||
{ lib, modulesPath, ... }:
|
{ lib, modulesPath, pkgs, ... }:
|
||||||
|
|
||||||
|
let port = 2342;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.photoprism = {
|
services.photoprism = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 2342;
|
port = port;
|
||||||
settings = {
|
settings = {
|
||||||
PHOTOPRISM_DEFAULT_LOCALE = "fr";
|
PHOTOPRISM_DEFAULT_LOCALE = "fr";
|
||||||
PHOTOPRISM_ADMIN_USERNAME = "admin";
|
PHOTOPRISM_ADMIN_USERNAME = "admin";
|
||||||
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
|
PHOHOPRISM_SITE_URL = "https://photoprism.cgiga.fr";
|
||||||
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
|
PHOTOPRISM_SITE_CAPTION = "PhotoPrism";
|
||||||
|
|
||||||
|
# DB access config
|
||||||
|
PHOTOPRISM_DATABASE_DRIVER = "mysql";
|
||||||
|
PHOTOPRISM_DATABASE_NAME = "photoprism";
|
||||||
|
PHOTOPRISM_DATABASE_SERVER = "/run/mysqld/mysqld.sock";
|
||||||
|
PHOTOPRISM_DATABASE_USER = "photoprism";
|
||||||
};
|
};
|
||||||
|
|
||||||
originalsPath = "/data/photos";
|
originalsPath = "/data/photos";
|
||||||
#importPath = "/photoprism/imports";
|
|
||||||
|
|
||||||
address = "localhost";
|
address = "localhost";
|
||||||
|
|
||||||
#passwordFile = "/passwords/photoprism";
|
#importPath = "/photoprism/imports";
|
||||||
|
passwordFile = "/passwords/photoprism";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mysql = {
|
||||||
|
enable = true;
|
||||||
|
dataDir = "/data/mysql";
|
||||||
|
package = pkgs.mariadb;
|
||||||
|
ensureDatabases = [ "photoprism" ];
|
||||||
|
ensureUsers = [{
|
||||||
|
name = "photoprism";
|
||||||
|
ensurePermissions = {
|
||||||
|
"photoprism.*" = "ALL PRIVILEGES";
|
||||||
|
};
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
|
services.nginx.virtualHosts."photoprism.cgiga.fr" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
serverAliases = [];
|
serverAliases = [];
|
||||||
locations."/".proxyPass = "http://localhost:2342/";
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${toString port}/";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue