diff options
Diffstat (limited to 'nixos/modules/services/misc/gurobi.nix')
-rw-r--r-- | nixos/modules/services/misc/gurobi.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gurobi.nix b/nixos/modules/services/misc/gurobi.nix new file mode 100644 index 000000000000..9cd76a1e78f7 --- /dev/null +++ b/nixos/modules/services/misc/gurobi.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"; + }; + }; + }; +} |