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:
parent
a9c65b31b9
commit
a5a13c4e43
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue