forked from mirrors/nixpkgs
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
nixos/modules
|
@ -35,6 +35,7 @@
|
||||||
./misc/assertions.nix
|
./misc/assertions.nix
|
||||||
./misc/check-config.nix
|
./misc/check-config.nix
|
||||||
./misc/crashdump.nix
|
./misc/crashdump.nix
|
||||||
|
./misc/gurobi.nix
|
||||||
./misc/ids.nix
|
./misc/ids.nix
|
||||||
./misc/lib.nix
|
./misc/lib.nix
|
||||||
./misc/locate.nix
|
./misc/locate.nix
|
||||||
|
|
41
nixos/modules/services/misc/gurobi.nix
Normal file
41
nixos/modules/services/misc/gurobi.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue