Add homebox

This commit is contained in:
muon 2025-01-13 12:35:13 +00:00
parent 40eb62a6bd
commit 411024cd3c
6 changed files with 52 additions and 8 deletions

View file

@ -35,9 +35,15 @@ in {
mods.wireguard.id = 2;
mods.i2p.enable = true;
mods.server.homebox.enable = true;
mods.server.nginx.ports.homebox = 3002;
services.xserver.windowManager.i3.enable = true;
services.actual.enable = true;
virtualisation.virtualbox.host.enable = true;
users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" ];
# Proprietary </3
mods.unfree.steam.enable = true;
mods.unfree.nvidia.enable = true;

View file

@ -1,6 +1,7 @@
{ pkgs, lib, config, ... }: {
mods.server.nginx.ports = {
photos = 3001;
homebox = 3002;
search = 8081;
videos = 8082;

View file

@ -13,5 +13,6 @@
./search.nix
./nginx.nix
./frontends.nix
./homebox.nix
];
}

View file

@ -9,6 +9,10 @@ in with lib; {
default = false;
description = "enables grav service";
};
location = mkOption {
default = "/srv/grav";
description = "location for homebox data";
};
};
};
@ -18,7 +22,7 @@ in with lib; {
services.grav = mkIf cfg.grav.enable {
inherit port;
enable = true;
root = "/curr/grav/grav";
root = cfg.grav.location;
phpPackage = pkgs.php81;
};
users.users.${config.mods.user.name}.extraGroups = lib.mkAfter [ "grav" ];

View file

@ -0,0 +1,36 @@
{ pkgs, lib, config, ... }:
let
cfg = config.mods.server.homebox;
port = config.mods.server.nginx.ports.homebox;
in with lib; {
options.mods.server = {
homebox = {
enable = mkEnableOption {
default = false;
description = "enables homebox server";
};
location = mkOption {
default = "/srv/homebox/data";
description = "location for homebox data";
};
};
};
config = mkIf cfg.enable {
services.homebox = {
enable = true;
settings = {
HBOX_WEB_PORT = toString port;
HBOX_WEB_HOST = "0.0.0.0";
HBOX_STORAGE_DATA = cfg.location;
HBOX_STORAGE_SQLITE_URL =
"${cfg.location}/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
HBOX_OPTIONS_ALLOW_REGISTRATION = "true";
HBOX_MODE = "production";
};
};
systemd.services.homebox.serviceConfig.WorkingDirectory =
mkForce cfg.location;
};
}

View file

@ -1,4 +1,3 @@
{ pkgs, lib, config, ... }: {
options.mods.server.photoprism = {
enable = lib.mkEnableOption {
@ -7,7 +6,6 @@
};
};
config = lib.mkIf config.mods.server.photoprism.enable {
services.photoprism = {
enable = true;
@ -37,9 +35,7 @@
ensureDatabases = [ "photoprism" ];
ensureUsers = [{
name = "photoprism";
ensurePermissions = {
"photoprism.*" = "ALL PRIVILEGES";
};
ensurePermissions = { "photoprism.*" = "ALL PRIVILEGES"; };
}];
};
};