From b7a07313cc72219964b93e47c36fffeed314a351 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Thu, 11 Oct 2018 12:15:25 +0200 Subject: [PATCH] move the codeName to /.codeName Make the codeName globally accessible in the repo. The release is not only for NixOS anymore. --- .codeName | 1 + lib/trivial.nix | 3 +++ nixos/modules/misc/version.nix | 4 +--- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 .codeName diff --git a/.codeName b/.codeName new file mode 100644 index 000000000000..0bb82a2888e3 --- /dev/null +++ b/.codeName @@ -0,0 +1 @@ +Koi diff --git a/lib/trivial.nix b/lib/trivial.nix index 938df6ced476..811c298d8620 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -98,6 +98,9 @@ rec { # The current nixpkgs version number as string. release = lib.strings.fileContents ../.version; + # Note: the first letter is bumped on every release. It's an animal. + codeName = lib.strings.fileContents ../.codeName; + # 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 6d78b7c593f8..fd77f6372720 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