From 2a838cb6d7421a38d008c935aa76650eefb80be0 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 15 Nov 2018 21:51:29 +0100 Subject: [PATCH] group the release info this makes the codename globally accessible in the repo. The release is not only for NixOS anymore. --- lib/trivial.nix | 7 +++++++ nixos/modules/misc/version.nix | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/trivial.nix b/lib/trivial.nix index e31cf73d27c..17489311236 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -129,6 +129,13 @@ rec { /* Returns the current nixpkgs release number as string. */ release = lib.strings.fileContents ../.version; + /* Returns the current nixpkgs release code name. + + On each release the first letter is bumped and a new animal is chosen + starting with that new letter. + */ + codeName = "Koi"; + /* Returns the current nixpkgs version suffix as string. */ versionSuffix = let suffixFile = ../.version-suffix; diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 6d78b7c593f..fd77f637272 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -43,6 +43,7 @@ in nixos.codeName = mkOption { readOnly = true; type = types.str; + default = lib.trivial.codeName; description = "The NixOS release code name (e.g. Emu)."; }; @@ -79,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