The /var/trac directory needs to be accessible by the webserver user
svn path=/nixos/trunk/; revision=16962
This commit is contained in:
parent
fc69e22e3a
commit
f6f6bfbc2f
@ -18,6 +18,29 @@ in
|
|||||||
description = "URL path in which Trac projects can be accessed";
|
description = "URL path in which Trac projects can be accessed";
|
||||||
default = "/projects";
|
default = "/projects";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
projects = mkOption {
|
||||||
|
description = "List of projects that should be provided by Trac. If they are not defined yet empty projects are created.";
|
||||||
|
default = [];
|
||||||
|
example = [ { identifier = "myproject";
|
||||||
|
name = "My Project";
|
||||||
|
databaseURL="postgres://root:password@/tracdb";
|
||||||
|
subversionRepository="/data/subversion/myproject"; } ];
|
||||||
|
};
|
||||||
|
|
||||||
|
user = mkOption {
|
||||||
|
default = "wwwrun";
|
||||||
|
description = "
|
||||||
|
User account under which Trac runs.
|
||||||
|
";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = mkOption {
|
||||||
|
default = "wwwrun";
|
||||||
|
description = "
|
||||||
|
Group under which Trac runs.
|
||||||
|
";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
extraModules = [
|
extraModules = [
|
||||||
@ -45,4 +68,18 @@ in
|
|||||||
"${subversion}/lib/python2.5/site-packages";
|
"${subversion}/lib/python2.5/site-packages";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
startupScript = pkgs.writeScript "activateTrac" ''
|
||||||
|
mkdir -p /var/trac
|
||||||
|
chown ${config.user}:${config.group} /var/trac
|
||||||
|
|
||||||
|
${pkgs.lib.concatMapStrings (project:
|
||||||
|
''
|
||||||
|
if [ ! -d /var/trac/${project.identifier} ]
|
||||||
|
then
|
||||||
|
export PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/python2.5/site-packages
|
||||||
|
${pkgs.pythonPackages.trac}/bin/trac-admin /var/trac/${project.identifier} initenv "${project.name}" "${project.databaseURL}" svn "${project.subversionRepository}"
|
||||||
|
fi
|
||||||
|
'' ) (config.projects)}
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user