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