diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-09-13 18:58:55 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-02-05 23:15:18 +0100 |
commit | 7e9b745174092b5eee25890d5d377db58236d3dd (patch) | |
tree | f09c5bf62c03e849d7d7bbd27e61b486a1fb2e8f /nixos/modules/installer | |
parent | 855fcc324a5e83d3abced135d4b6ecad02cc022a (diff) | |
download | nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar.gz nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar.bz2 nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar.lz nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar.xz nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.tar.zst nixlib-7e9b745174092b5eee25890d5d377db58236d3dd.zip |
nixos-version: Add --json flag and show system.configurationRevision
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/tools/nixos-version.sh | 5 | ||||
-rw-r--r-- | nixos/modules/installer/tools/tools.nix | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-version.sh b/nixos/modules/installer/tools/nixos-version.sh index 190c49a33ec6..0117aa1549cb 100644 --- a/nixos/modules/installer/tools/nixos-version.sh +++ b/nixos/modules/installer/tools/nixos-version.sh @@ -8,6 +8,11 @@ case "$1" in --hash|--revision) echo "@revision@" ;; + --json) + cat <<EOF +{"nixosVersion": "@version@", "nixpkgsRevision": "@revision@", "configurationRevision": "@configurationRevision@"} +EOF + ;; *) echo "@version@ (@codeName@)" ;; diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 9c8e26ba2429..47fa4725288d 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -48,6 +48,7 @@ let name = "nixos-version"; src = ./nixos-version.sh; inherit (config.system.nixos) version codeName revision; + inherit (config.system) configurationRevision; }; nixos-enter = makeProg { |