first working fossil server

This commit is contained in:
Cyryl Płotnicki 2022-10-23 09:48:16 +01:00
parent a93b230e03
commit 6545f447a4

View file

@ -3,6 +3,7 @@ let
port = 8081;
domain = "fossil.cyplo.dev";
baseurl = "https://${domain}";
path = "/var/lib/fossil";
in {
imports = [ ../nginx.nix ];
@ -22,14 +23,18 @@ in {
containerPort = port;
hostPort = port;
}];
bindMounts = {
"${path}" = {
hostPath = "${path}";
isReadOnly = false;
};
};
config = { config, pkgs, ... }:
let
path = "/var/lib/fossil";
repoPath = "${path}/repo.fossil";
user = "fossil";
group = "fossil";
in {
environment.systemPackages = [ pkgs.fossil ];
users.groups = { "${group}" = { }; };
users.users = {
fossil = {
@ -53,9 +58,9 @@ in {
Group = group;
WorkingDirectory = path;
ReadWritePaths = [ path ];
ExecStart = "${pkgs.fossil}/bin/fossil server --localhost --https"
+ " --port ${toString port}" + " --baseurl ${baseurl}"
+ " --create ${repoPath}";
ExecStart = "${pkgs.fossil}/bin/fossil server" + " --localhost"
+ " --https" + " --port ${toString port}"
+ " --baseurl ${baseurl}" + " --repolist ${path}";
Restart = "always";
RestartSec = 3;
};
@ -63,5 +68,4 @@ in {
};
};
};
}