nixos/slurm: expose to path config files

This adds a new internal option, services.slurm.etcSlurm such
that other modules can access slurm's config files. This is
needed, for example, when a service wants to run a slurm command.
This commit is contained in:
Markus Kowalewski 2021-03-10 23:12:47 +01:00
parent 86ee8dd8ff
commit c923b4c71b
No known key found for this signature in database
GPG Key ID: D865C8A91D7025EB
1 changed files with 10 additions and 1 deletions

View File

@ -274,6 +274,15 @@ in
''; '';
}; };
etcSlurm = mkOption {
type = types.path;
internal = true;
default = etcSlurm;
description = ''
Path to directory with slurm config files. This option is set by default from the
Slurm module and is meant to make the Slurm config file available to other modules.
'';
};
}; };
@ -308,7 +317,7 @@ in
#!/bin/sh #!/bin/sh
if [ -z "$SLURM_CONF" ] if [ -z "$SLURM_CONF" ]
then then
SLURM_CONF="${etcSlurm}/slurm.conf" "$EXE" "\$@" SLURM_CONF="${cfg.etcSlurm}/slurm.conf" "$EXE" "\$@"
else else
"$EXE" "\$0" "$EXE" "\$0"
fi fi