diff options
author | pennae <github@quasiparticle.net> | 2021-12-05 20:40:24 +0100 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2021-12-09 01:12:13 +0100 |
commit | e24a8775a86905ad001c4c965a7d180b41c10c52 (patch) | |
tree | 62da74c469bec798898d88029919f2bbd9f01442 /nixos/modules/misc/version.nix | |
parent | 70b105d1d062369c7489b0045df5a8b86bac5dd6 (diff) | |
download | nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.gz nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.bz2 nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.lz nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.xz nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.zst nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.zip |
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.
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r-- | nixos/modules/misc/version.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 8f246a9278b..fc0d65d5148 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -1,9 +1,10 @@ -{ config, lib, pkgs, ... }: +{ config, lib, options, pkgs, ... }: with lib; let cfg = config.system.nixos; + opt = options.system.nixos; in { @@ -53,6 +54,7 @@ in stateVersion = mkOption { type = types.str; default = cfg.release; + defaultText = literalExpression "config.${opt.release}"; description = '' Every once in a while, a new NixOS release may change configuration defaults in a way incompatible with stateful |