NixOS

August 06, 2015

Services

Thumbor

thumbor.nix:

{ pkgs, ... }:
{

  users.extraUsers.thumbor.isNormalUser = true;
  systemd.services.thumbor = {
    description = "thumbor";
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];
    serviceConfig = {
      WorkingDirectory = "/home/thumbor";
      ExecStart = "${pkgs.python27Packages.thumbor}/bin/thumbor -p 3000";
      Restart = "always";
      User = "thumbor";
    };
  };

}

Etherpad

{ pkgs, ... }:
{

  users.extraUsers.etherpad.isNormalUser = true;
  systemd.services.etherpad = {
    description = "etherpad";
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];
    serviceConfig = {
      WorkingDirectory = "/home/etherpad";
      ExecStart = "/home/etherpad/etherpad-lite/bin/run.sh";
      Restart = "always";
      User = "etherpad";
    };
  };

}

Blazegraph

{ pkgs, ... }:
let

  blazegraphJar = pkgs.fetchurl {
    url = "https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_RELEASE_2_1_5/blazegraph.jar";
    sha256 = "043nfc6mgmd5mxmwfcfl082y96iaqnwminn4rxbizxrs3dzaxbpv";
  };

in
{

  users.extraUsers.blazegraph.isNormalUser = true;
  systemd.services.blazegraph = {
    description = "blazegraph";
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];
    serviceConfig = {
      WorkingDirectory = "/home/blazegraph";
      ExecStart = "${pkgs.openjdk}/bin/java -server -Xmx2g -Djetty.port=3006 -jar ${blazegraphJar}";
      Restart = "always";
      User = "blazegraph";
    };
  };

}