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