mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix: 🐛 Replace dataDir with module path
This commit is contained in:
parent
d6b15b1b85
commit
da1e209f9e
|
|
@ -21,14 +21,6 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
dataDir = mkOption {
|
|
||||||
type = lib.types.path;
|
|
||||||
default = "/var/lib/${name}";
|
|
||||||
description = ''
|
|
||||||
Directory where the server will store its data.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = name;
|
default = name;
|
||||||
|
|
@ -125,7 +117,7 @@ in {
|
||||||
RuntimeDirectoryMode = "0700";
|
RuntimeDirectoryMode = "0700";
|
||||||
|
|
||||||
# Set the working directory to the data directory
|
# Set the working directory to the data directory
|
||||||
WorkingDirectory = cfg.dataDir;
|
WorkingDirectory = "${pkgs.versia-server}/versia-server";
|
||||||
|
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
|
|
@ -162,7 +154,7 @@ in {
|
||||||
RuntimeDirectoryMode = "0700";
|
RuntimeDirectoryMode = "0700";
|
||||||
|
|
||||||
# Set the working directory to the data directory
|
# Set the working directory to the data directory
|
||||||
WorkingDirectory = cfg.dataDir;
|
WorkingDirectory = "${pkgs.versia-server-worker}/versia-server-worker";
|
||||||
|
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
|
|
@ -179,8 +171,6 @@ in {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = ["d ${cfg.dataDir} - - - - ${cfg.user} ${cfg.group}"];
|
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
groups = {
|
groups = {
|
||||||
"${cfg.group}" = {};
|
"${cfg.group}" = {};
|
||||||
|
|
@ -190,7 +180,6 @@ in {
|
||||||
"${cfg.user}" = {
|
"${cfg.user}" = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
home = cfg.dataDir;
|
|
||||||
packages = [pkgs.versia-server pkgs.versia-server-worker];
|
packages = [pkgs.versia-server pkgs.versia-server-worker];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue