summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarkus Kowalewski <markus.kowalewski@gmail.com>2019-11-05 22:00:23 +0100
committerMarkus Kowalewski <markus.kowalewski@gmail.com>2019-11-10 14:04:54 +0100
commit8219a3b7135f11035884df8196136f69f522bca1 (patch)
treece30e41688728094d3db3cb0b65f887fe54ce36a
parent9e733df81faeebdd39fcb7fe8b1e72a6864f0635 (diff)
downloadnixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar.gz
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar.bz2
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar.lz
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar.xz
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.tar.zst
nixpkgs-8219a3b7135f11035884df8196136f69f522bca1.zip
nixos/slurm: fix X11 with spank module
* Fix path in module for slurm to find plugstack.conf
* Fix configure flags so that slurm can be compiled
  without internal X11 support (required for spank-x11).
-rw-r--r--nixos/modules/services/computing/slurm/slurm.nix12
-rw-r--r--pkgs/servers/computing/slurm/default.nix3
2 files changed, 10 insertions, 5 deletions
diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix
index d1a1383e45b..28907c13c24 100644
--- a/nixos/modules/services/computing/slurm/slurm.nix
+++ b/nixos/modules/services/computing/slurm/slurm.nix
@@ -18,7 +18,7 @@ let
       ${optionalString (cfg.controlAddr != null) ''controlAddr=${cfg.controlAddr}''}
       ${toString (map (x: "NodeName=${x}\n") cfg.nodeName)}
       ${toString (map (x: "PartitionName=${x}\n") cfg.partitionName)}
-      PlugStackConfig=${plugStackConfig}
+      PlugStackConfig=${plugStackConfig}/plugstack.conf
       ProctrackType=${cfg.procTrackType}
       ${cfg.extraConfig}
     '';
@@ -48,7 +48,6 @@ let
     name = "etc-slurm";
     paths = [ configFile cgroupConfig plugStackConfig ] ++ cfg.extraConfigPaths;
   };
-
 in
 
 {
@@ -112,7 +111,7 @@ in
 
       package = mkOption {
         type = types.package;
-        default = pkgs.slurm;
+        default = pkgs.slurm.override { enableX11 = ! cfg.enableSrunX11; };
         defaultText = "pkgs.slurm";
         example = literalExample "pkgs.slurm-full";
         description = ''
@@ -178,9 +177,14 @@ in
           If enabled srun will accept the option "--x11" to allow for X11 forwarding
           from within an interactive session or a batch job. This activates the
           slurm-spank-x11 module. Note that this option also enables
-          'services.openssh.forwardX11' on the client.
+          <option>services.openssh.forwardX11</option> on the client.
 
           This option requires slurm to be compiled without native X11 support.
+          The default behavior is to re-compile the slurm package with native X11
+          support disabled if this option is set to true.
+
+          To use the native X11 support add <literal>PrologFlags=X11</literal> in <option>extraConfig</option>.
+          Note that this method will only work RSA SSH host keys.
         '';
       };
 
diff --git a/pkgs/servers/computing/slurm/default.nix b/pkgs/servers/computing/slurm/default.nix
index 916c681ab16..e0c7e635d6c 100644
--- a/pkgs/servers/computing/slurm/default.nix
+++ b/pkgs/servers/computing/slurm/default.nix
@@ -48,7 +48,8 @@ stdenv.mkDerivation rec {
       "--with-zlib=${zlib}"
       "--sysconfdir=/etc/slurm"
     ] ++ (optional (gtk2 == null)  "--disable-gtktest")
-      ++ (optional enableX11 "--with-libssh2=${libssh2.dev}");
+      ++ (optional enableX11 "--with-libssh2=${libssh2.dev}")
+      ++ (optional (!enableX11) "--disable-x11");
 
 
   preConfigure = ''