This commit is contained in:
2026-08-11 22:13:53 +03:00
parent 056e5895fe
commit 411c118500
29 changed files with 543 additions and 517 deletions
+10 -23
View File
@@ -5,8 +5,11 @@
...
}:
let
sourceDir = "${xlib.dirs.services-mnt-folder}/homebox";
targetDir = "/var/lib/homebox";
storage = xlib.helpers.mkServiceStorage {
name = "homebox";
user = "homebox";
group = "homebox";
};
in
{
services.homebox = {
@@ -14,33 +17,17 @@ in
settings = {
HBOX_WEB_HOST = "0.0.0.0";
HBOX_WEB_PORT = "7745";
HBOX_STORAGE_CONN_STRING = "file://${targetDir}";
HBOX_STORAGE_CONN_STRING = "file://${storage.target}";
HBOX_STORAGE_PREFIX_PATH = "data";
HBOX_DATABASE_DRIVER = "sqlite3";
HBOX_DATABASE_SQLITE_PATH = "${targetDir}/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
HBOX_DATABASE_SQLITE_PATH = "${storage.target}/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
HBOX_OPTIONS_ALLOW_REGISTRATION = "true";
HBOX_OPTIONS_GITHUB_RELEASE_CHECK = "false";
HBOX_MODE = "production";
HOME = "${targetDir}";
TMPDIR = "${targetDir}/tmp";
HOME = "${storage.target}";
TMPDIR = "${storage.target}/tmp";
};
};
systemd = {
tmpfiles.rules = [
"d ${sourceDir} 0755 homebox homebox -"
"z ${sourceDir} 0755 homebox homebox -"
];
mounts = [
{
enable = true;
options = "bind,x-systemd.automount,nofail";
requires = [ "local-fs.target" ];
type = "none";
wantedBy = [ "multi-user.target" ];
what = "${sourceDir}";
where = "${targetDir}";
}
];
};
systemd = storage.systemd;
}