D'oh
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
6171f13ed5
commit
418fa3bb33
|
@ -35,7 +35,6 @@
|
||||||
./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
|
||||||
|
@ -120,6 +119,7 @@
|
||||||
./services/misc/felix.nix
|
./services/misc/felix.nix
|
||||||
./services/misc/folding-at-home.nix
|
./services/misc/folding-at-home.nix
|
||||||
./services/misc/gpsd.nix
|
./services/misc/gpsd.nix
|
||||||
|
./services/misc/gurobi.nix
|
||||||
./services/misc/nix-daemon.nix
|
./services/misc/nix-daemon.nix
|
||||||
./services/misc/nix-gc.nix
|
./services/misc/nix-gc.nix
|
||||||
./services/misc/nixos-manual.nix
|
./services/misc/nixos-manual.nix
|
||||||
|
|
|
@ -23,21 +23,21 @@ in {
|
||||||
type = types.nullOr types.string;
|
type = types.nullOr types.string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf (cfg.license != null || cfg.tokenServerAddress != null) {
|
config = mkIf (cfg.license != null || cfg.tokenServerAddress != null) {
|
||||||
assertions = [ {
|
assertions = [ {
|
||||||
assertion = cfg.license == null || cfg.tokenServerAddress == null;
|
assertion = cfg.license == null || cfg.tokenServerAddress == null;
|
||||||
message = "Please only set one of a gurobi license file and a gurobi token server address";
|
message = "Please only set one of a gurobi license file and a gurobi token server address";
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
environment.variables.GRB_LICENSE_FILE = if cfg.license != null
|
environment.variables.GRB_LICENSE_FILE = if cfg.license != null
|
||||||
then cfg.license
|
then cfg.license
|
||||||
else pkgs.writeTextFile {
|
else pkgs.writeTextFile {
|
||||||
name = "gurobi-generated-license";
|
name = "gurobi-generated-license";
|
||||||
text = "TOKENSERVER=${cfg.tokenServerAddress}";
|
text = "TOKENSERVER=${cfg.tokenServerAddress}";
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.gurobi ];
|
environment.systemPackages = [ pkgs.gurobi ];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue