diff options
author | Shea Levy <shea@shealevy.com> | 2013-10-16 10:58:32 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2013-10-16 11:02:05 -0400 |
commit | a5a13c4e437a1c4415741b0c8fb71b85952b33f1 (patch) | |
tree | 7b0d7c55e9d680671f9079b4d83092e489aab72b /nixos/modules/services | |
parent | a9c65b31b9cdc20ad65c52ee357dbe7125a6ca56 (diff) | |
download | nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar.gz nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar.bz2 nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar.lz nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar.xz nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.tar.zst nixpkgs-a5a13c4e437a1c4415741b0c8fb71b85952b33f1.zip |
Add gurobi token server service
Not yet tested, I don't have a license yet Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'nixos/modules/services')
-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 00000000000..9cd76a1e78f --- /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"; + }; + }; + }; +} |