about summary refs log tree commit diff
path: root/nixos/modules/misc/version.nix
diff options
context:
space:
mode:
authorrembo10 <801525+rembo10@users.noreply.github.com>2019-02-18 09:14:14 +0800
committerGitHub <noreply@github.com>2019-02-18 09:14:14 +0800
commit8e151c1e86c88995b10328f600f3c54f2af399a5 (patch)
treeb6f2df0c43409a2f3e2fef0897e82135e06658db /nixos/modules/misc/version.nix
parent8d1ad4317c9a90724effa4a72bf18f1e7c0847e4 (diff)
parentfdc9cbb793c8a90bda0e25acd3fa38ef0200a001 (diff)
downloadnixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar.gz
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar.bz2
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar.lz
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar.xz
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.tar.zst
nixlib-8e151c1e86c88995b10328f600f3c54f2af399a5.zip
Merge branch 'master' into headphones
Diffstat (limited to 'nixos/modules/misc/version.nix')
-rw-r--r--nixos/modules/misc/version.nix10
1 files changed, 3 insertions, 7 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index c593adcdae6e..c576cf4cb925 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -5,7 +5,6 @@ with lib;
 let
   cfg = config.system.nixos;
 
-  revisionFile = "${toString pkgs.path}/.git-revision";
   gitRepo      = "${toString pkgs.path}/.git";
   gitCommitId  = lib.substring 0 7 (commitIdFromGitRepo gitRepo);
 in
@@ -37,15 +36,14 @@ in
     nixos.revision = mkOption {
       internal = true;
       type = types.str;
-      default = if pathIsDirectory gitRepo then commitIdFromGitRepo gitRepo
-                else if pathExists revisionFile then fileContents revisionFile
-                else "master";
+      default = trivial.revisionWithDefault "master";
       description = "The Git revision from which this NixOS configuration was built.";
     };
 
     nixos.codeName = mkOption {
       readOnly = true;
       type = types.str;
+      default = trivial.codeName;
       description = "The NixOS release code name (e.g. <literal>Emu</literal>).";
     };
 
@@ -82,9 +80,6 @@ in
       version = mkDefault (cfg.release + cfg.versionSuffix);
       revision      = mkIf (pathIsDirectory gitRepo) (mkDefault            gitCommitId);
       versionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
-
-      # Note: the first letter is bumped on every release.  It's an animal.
-      codeName = "Koi";
     };
 
     # Generate /etc/os-release.  See
@@ -98,6 +93,7 @@ in
         VERSION_CODENAME=${toLower cfg.codeName}
         VERSION_ID="${cfg.version}"
         PRETTY_NAME="NixOS ${cfg.version} (${cfg.codeName})"
+        LOGO="nix-snowflake"
         HOME_URL="https://nixos.org/"
         SUPPORT_URL="https://nixos.org/nixos/support.html"
         BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"