From e24a8775a86905ad001c4c965a7d180b41c10c52 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 5 Dec 2021 20:40:24 +0100 Subject: 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. --- nixos/modules/services/computing/slurm/slurm.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nixos/modules/services/computing') diff --git a/nixos/modules/services/computing/slurm/slurm.nix b/nixos/modules/services/computing/slurm/slurm.nix index 0c96f3231329..02dfe2fe882f 100644 --- a/nixos/modules/services/computing/slurm/slurm.nix +++ b/nixos/modules/services/computing/slurm/slurm.nix @@ -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 -- cgit 1.4.1