parent
de8b43a2e2
commit
a859ef91f0
@ -1,79 +0,0 @@ |
||||
{ config, lib, pkgs, ... }: |
||||
|
||||
let |
||||
cfg = config.services.trac; |
||||
|
||||
inherit (lib) mkEnableOption mkIf mkOption types; |
||||
|
||||
in { |
||||
|
||||
options = { |
||||
|
||||
services.trac = { |
||||
enable = mkEnableOption "Trac service"; |
||||
|
||||
listen = { |
||||
ip = mkOption { |
||||
type = types.str; |
||||
default = "0.0.0.0"; |
||||
description = '' |
||||
IP address that Trac should listen on. |
||||
''; |
||||
}; |
||||
|
||||
port = mkOption { |
||||
type = types.port; |
||||
default = 8000; |
||||
description = '' |
||||
Listen port for Trac. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
dataDir = mkOption { |
||||
default = "/var/lib/trac"; |
||||
type = types.path; |
||||
description = '' |
||||
The directory for storing the Trac data. |
||||
''; |
||||
}; |
||||
|
||||
openFirewall = mkOption { |
||||
type = types.bool; |
||||
default = false; |
||||
description = '' |
||||
Open ports in the firewall for Trac. |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
}; |
||||
|
||||
config = mkIf cfg.enable { |
||||
|
||||
systemd.services.trac = { |
||||
description = "Trac server"; |
||||
wantedBy = [ "multi-user.target" ]; |
||||
serviceConfig = { |
||||
DynamicUser = true; |
||||
StateDirectory = baseNameOf cfg.dataDir; |
||||
ExecStart = '' |
||||
${pkgs.trac}/bin/tracd -s \ |
||||
-b ${toString cfg.listen.ip} \ |
||||
-p ${toString cfg.listen.port} \ |
||||
${cfg.dataDir} |
||||
''; |
||||
}; |
||||
preStart = '' |
||||
if [ ! -e ${cfg.dataDir}/VERSION ]; then |
||||
${pkgs.trac}/bin/trac-admin ${cfg.dataDir} initenv Trac "sqlite:db/trac.db" |
||||
fi |
||||
''; |
||||
}; |
||||
|
||||
networking.firewall = mkIf cfg.openFirewall { |
||||
allowedTCPPorts = [ cfg.listen.port ]; |
||||
}; |
||||
|
||||
}; |
||||
} |
@ -1,19 +0,0 @@ |
||||
import ./make-test-python.nix ({ pkgs, ... }: { |
||||
name = "trac"; |
||||
meta = with pkgs.lib.maintainers; { |
||||
maintainers = [ mmahut ]; |
||||
}; |
||||
|
||||
nodes = { |
||||
machine = { ... }: { |
||||
services.trac.enable = true; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
start_all() |
||||
machine.wait_for_unit("trac.service") |
||||
machine.wait_for_open_port(8000) |
||||
machine.wait_until_succeeds("curl -fL http://localhost:8000/ | grep 'Trac Powered'") |
||||
''; |
||||
}) |
@ -1,56 +0,0 @@ |
||||
{ lib |
||||
, buildPythonApplication |
||||
, fetchPypi |
||||
, Babel |
||||
, docutils |
||||
, pygments |
||||
, pytz |
||||
, jinja2 |
||||
, pysqlite |
||||
, psycopg2 |
||||
, pymysql |
||||
, git |
||||
, setuptools |
||||
}: |
||||
|
||||
|
||||
buildPythonApplication rec { |
||||
pname = "trac"; |
||||
version = "1.4.1"; |
||||
|
||||
src = fetchPypi { |
||||
inherit version; |
||||
pname = "Trac"; |
||||
sha256 = "0d61ypn0j9wb8119bj3pj7s8swfjykdl0sz398p92k9bvxh4dayz"; |
||||
}; |
||||
|
||||
prePatch = '' |
||||
# Removing the date format tests as they are outdated |
||||
substituteInPlace trac/util/tests/__init__.py \ |
||||
--replace "suite.addTest(datefmt.test_suite())" "" |
||||
# Removing Pygments tests as per https://trac.edgewall.org/ticket/13229 |
||||
substituteInPlace trac/mimeview/tests/__init__.py \ |
||||
--replace "suite.addTest(pygments.test_suite())" "" |
||||
''; |
||||
|
||||
propagatedBuildInputs = [ |
||||
Babel |
||||
docutils |
||||
pygments |
||||
pytz |
||||
jinja2 |
||||
pysqlite |
||||
psycopg2 |
||||
pymysql |
||||
git |
||||
setuptools |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "Integrated SCM, wiki, issue tracker and project environment"; |
||||
homepage = "https://trac.edgewall.org/"; |
||||
license = licenses.bsd3; |
||||
maintainers = with maintainers; [ mmahut ]; |
||||
platforms = platforms.linux; |
||||
}; |
||||
} |
Loading…
Reference in new issue