mirror of
https://codeberg.org/muon/home.git
synced 2025-12-05 23:57:46 +00:00
Add homebox
This commit is contained in:
parent
40eb62a6bd
commit
411024cd3c
6 changed files with 52 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
mods.server.nginx.ports = {
|
||||
photos = 3001;
|
||||
homebox = 3002;
|
||||
|
||||
search = 8081;
|
||||
videos = 8082;
|
||||
|
|
|
|||
|
|
@ -13,5 +13,6 @@
|
|||
./search.nix
|
||||
./nginx.nix
|
||||
./frontends.nix
|
||||
./homebox.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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" ];
|
||||
|
|
|
|||
36
modules/nixos/server/homebox.nix
Normal file
36
modules/nixos/server/homebox.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
@ -35,12 +33,10 @@
|
|||
dataDir = "/data/mysql";
|
||||
package = pkgs.mariadb;
|
||||
ensureDatabases = [ "photoprism" ];
|
||||
ensureUsers = [ {
|
||||
ensureUsers = [{
|
||||
name = "photoprism";
|
||||
ensurePermissions = {
|
||||
"photoprism.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
} ];
|
||||
ensurePermissions = { "photoprism.*" = "ALL PRIVILEGES"; };
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue