treewide: set defaultText for options using simple path defaults
adds defaultText for all options that set their default to a path expression using the ubiquitous `cfg` shortcut bindings.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ config, lib, options, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.slurm;
|
||||
opt = options.services.slurm;
|
||||
# configuration file can be generated by http://slurm.schedmd.com/configurator.html
|
||||
|
||||
defaultUser = "slurm";
|
||||
@@ -89,6 +90,7 @@ in
|
||||
storageUser = mkOption {
|
||||
type = types.str;
|
||||
default = cfg.user;
|
||||
defaultText = literalExpression "config.${opt.user}";
|
||||
description = ''
|
||||
Database user name.
|
||||
'';
|
||||
@@ -153,6 +155,7 @@ in
|
||||
controlAddr = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = cfg.controlMachine;
|
||||
defaultText = literalExpression "config.${opt.controlMachine}";
|
||||
example = null;
|
||||
description = ''
|
||||
Name that ControlMachine should be referred to in establishing a
|
||||
|
||||
Reference in New Issue
Block a user