From ef64840085be2f457b3e21c71e989fcc3fe99f04 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Apr 2009 17:03:58 +0000 Subject: [PATCH] * Don't hardcode values specific to the program transformation / Stratego wikis. svn path=/nixos/trunk/; revision=15408 --- upstart-jobs/apache-httpd/twiki.nix | 50 +++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/upstart-jobs/apache-httpd/twiki.nix b/upstart-jobs/apache-httpd/twiki.nix index 54614aca24c..7e524144e64 100644 --- a/upstart-jobs/apache-httpd/twiki.nix +++ b/upstart-jobs/apache-httpd/twiki.nix @@ -3,10 +3,9 @@ let inherit (pkgs.lib) mkOption; - inherit (config) urlPrefix distDir; - dataDir = "/data/pt-wiki/data"; - pubDir = "/data/pt-wiki/pub"; + dataDir = config.dataDir; # "/data/pt-wiki/data"; + pubDir = config.pubDir; # "/data/pt-wiki/pub"; scriptUrlPath = "/bin"; pubUrlPath = "/pub"; @@ -17,19 +16,18 @@ let dispScriptUrlPath = ""; dispViewPath = ""; - twikiName = "Program Transformation Wiki"; startWeb = config.startWeb; - registrationDomain = "ewi.tudelft.nl"; defaultUrlHost = ""; # Build the TWiki CGI and configuration files. twikiRoot = (import /etc/nixos/services/twiki/twiki-instance.nix).twiki { - name = "pt-wiki"; + name = "wiki-instance"; pubdir = pubDir; datadir = dataDir; - inherit twikiName scriptUrlPath pubUrlPath absHostPath - dispPubUrlPath dispScriptUrlPath dispViewPath - registrationDomain defaultUrlHost; + inherit scriptUrlPath pubUrlPath absHostPath + dispPubUrlPath dispScriptUrlPath dispViewPath defaultUrlHost; + twikiName = config.twikiName; + registrationDomain = config.registrationDomain; }; plugins = import /etc/nixos/services/twiki/server-pkgs/twiki-plugins.nix; @@ -111,4 +109,38 @@ in { Disallow: /pt/bin/ ''; + options = { + + dataDir = mkOption { + example = "/data/wiki/data"; + description = " + Path to the directory that holds the Wiki data. + "; + }; + + pubDir = mkOption { + example = "/data/wiki/pub"; + description = " + Path to the directory that holds uploaded files. + "; + }; + + twikiName = mkOption { + default = "Wiki"; + example = "Foobar Wiki"; + description = " + Name of this Wiki. + "; + }; + + registrationDomain = mkOption { + example = "example.org"; + description = " + Domain from which registrations are permitted. Use `all' to + permit registrations from anywhere. + "; + }; + + }; + } \ No newline at end of file