Unverified Commit 8c009d65 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

nixos/slurm: fix wrapper script variable expansion, and refactor (#470374)

parents 4911c532 96b408c7
Loading
Loading
Loading
Loading
+21 −25
Original line number Diff line number Diff line
@@ -336,10 +336,7 @@ in

  config =
    let
      wrappedSlurm = pkgs.stdenv.mkDerivation {
        name = "wrappedSlurm";

        builder = pkgs.writeText "builder.sh" ''
      wrappedSlurm = pkgs.runCommand "wrappedSlurm" { } ''
        mkdir -p $out/bin
        find  ${lib.getBin cfg.package}/bin -type f -executable | while read EXE
        do
@@ -347,7 +344,7 @@ in
          wrappername="$out/bin/$exename"
          cat > "$wrappername" <<EOT
        #!/bin/sh
          if [ -z "$SLURM_CONF" ]
        if [ -z "\$SLURM_CONF" ]
        then
          SLURM_CONF="${cfg.etcSlurm}/slurm.conf" "$EXE" "\$@"
        else
@@ -360,7 +357,6 @@ in
        mkdir -p $out/share
        ln -s ${lib.getBin cfg.package}/share/man $out/share/man
      '';
      };

    in
    lib.mkIf (cfg.enableStools || cfg.client.enable || cfg.server.enable || cfg.dbdserver.enable) {