From 6545f447a42881f87f510bbedc556b3521adc807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 23 Oct 2022 09:48:16 +0100 Subject: [PATCH] first working fossil server --- nixos/boxes/vpsfree1/fossil.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/nixos/boxes/vpsfree1/fossil.nix b/nixos/boxes/vpsfree1/fossil.nix index 623c5290..4d1efcad 100644 --- a/nixos/boxes/vpsfree1/fossil.nix +++ b/nixos/boxes/vpsfree1/fossil.nix @@ -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 { }; }; }; - }