Add gurobi token server service

Not yet tested, I don't have a license yet

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-10-16 10:58:32 -04:00
parent a9c65b31b9
commit a5a13c4e43
2 changed files with 42 additions and 0 deletions

View file

@ -35,6 +35,7 @@
./misc/assertions.nix
./misc/check-config.nix
./misc/crashdump.nix
./misc/gurobi.nix
./misc/ids.nix
./misc/lib.nix
./misc/locate.nix

View file

@ -0,0 +1,41 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.services.gurobi.tokenServer;
in {
options = {
services.gurobi.tokenServer = {
enable = mkOption {
default = false;
description = "Whether to enable the Gurobi token server";
type = types.bool;
};
license = mkOption {
description = "Path to the Gurobi license file";
type = types.path;
};
};
};
config = mkIf cfg.enable {
systemd.services.gurobi-token-server = {
description = "Gurobi token server";
wantedBy = [ "multi-user.target" ];
environment.GRB_LICENSE_FILE = cfg.license;
serviceConfig = {
ExecStart = "${pkgs.gurobi}/bin/grb_ts";
Type = "forking";
};
};
};
}