Skip to content

Commit

Permalink
Merge pull request NixOS#288812 from hercules-ci/lib-flake-version
Browse files Browse the repository at this point in the history
`lib/` flake: fix `lib.version`
  • Loading branch information
roberth authored Mar 3, 2024
2 parents 62e1690 + 324a7aa commit 39327e4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

# We want readFile .version to return the version without a newline.
[.version]
insert_final_newline = false

# see https://nixos.org/nixpkgs/manual/#chap-conventions

# Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces
Expand Down
1 change: 0 additions & 1 deletion .version

This file was deleted.

1 change: 1 addition & 0 deletions .version
1 change: 1 addition & 0 deletions lib/.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.05
6 changes: 6 additions & 0 deletions lib/tests/test-with-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" {
echo "Running lib/tests/modules.sh"
bash lib/tests/modules.sh
echo "Checking lib.version"
nix-instantiate lib -A version --eval || {
echo "lib.version does not evaluate when lib is isolated from the rest of the nixpkgs tree"
exit 1
}
echo "Running lib/tests/filesystem.sh"
TEST_LIB=$PWD/lib bash lib/tests/filesystem.sh
Expand Down
2 changes: 1 addition & 1 deletion lib/trivial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ in {
version = release + versionSuffix;

/* Returns the current nixpkgs release number as string. */
release = lib.strings.fileContents ../.version;
release = lib.strings.fileContents ./.version;

/* The latest release that is supported, at the time of release branch-off,
if applicable.
Expand Down

0 comments on commit 39327e4

Please sign in to comment.