Author: eelco
Date: Fri Oct  8 12:47:03 2010
New Revision: 24182
URL: https://svn.nixos.org/websvn/nix/?rev=24182&sc=1

Log:
* Put the JIRA server in its own Xen domain.

Added:
   configurations/trunk/tud/mrkitty.nix

Added: configurations/trunk/tud/mrkitty.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/tud/mrkitty.nix        Fri Oct  8 12:47:03 2010        
(r24182)
@@ -0,0 +1,53 @@
+# JIRA server.
+
+{ config, pkgs, modulesPath, ... }:
+
+with pkgs.lib;
+
+let
+
+  jiraJetty = (import ../../services/jira/jira-instance.nix {
+    inherit pkgs;
+    dbHost = "webdsl.org";
+    dbPassword = import ./jira-password.nix;
+  }).jetty;
+
+in
+
+{
+  require = [ "${modulesPath}/virtualisation/xen-domU.nix" ./common.nix ];
+
+  networking.hostName = "mrkitty";
+
+  fileSystems = 
+    [ { mountPoint = "/";
+        label = "nixos";
+      }
+    ];
+
+  services.sshd.enable = true;
+
+  users.extraUsers = singleton
+    { name = "jira";
+      description = "JIRA bug tracker";
+    };
+
+  jobs.jira =
+    { description = "JIRA bug tracker";
+
+      startOn = "started network-interfaces";
+
+      preStart =
+        ''
+          mkdir -p /var/log/jetty /var/cache/jira /var/cache/jira/issues
+          chown jira /var/log/jetty /var/cache/jira /var/cache/jira/issues
+        '';
+
+      exec = "${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c 
'${jiraJetty}/bin/run-jetty'";
+
+      postStop =
+        ''
+          ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c 
'${jiraJetty}/bin/stop-jetty'
+        '';
+    };
+}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to