Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-version: output configurationRevision #161237

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

miallo
Copy link
Contributor

@miallo miallo commented Feb 21, 2022

It would be nice to be able to get the configurationRevision of the current system.

This allows the user to figure out more information about the generation.

Motivation for this change

It might also be used for #105910 to show additional information for generations in the list of all generations so that the user can have a better understanding of which generation is what.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable: => could not find relevant tests
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 21, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 21, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 21, 2022
@RaitoBezarius
Copy link
Member

So sorry it did not get any attention, can you fix the conflicts? I'm interested into getting this merged.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 22, 2022
@miallo miallo force-pushed the nixos-version-configuration-revision branch 2 times, most recently from 08a1b2b to 98d5869 Compare December 22, 2022 11:14
@miallo
Copy link
Contributor Author

miallo commented Dec 22, 2022

So sorry it did not get any attention, can you fix the conflicts? I'm interested into getting this merged.

Absolutely no problem :) I rebased it and switched it from --configurationRevision to --configuration-revision, since that feels a lot better from my perspective

Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -13,6 +13,13 @@ case "$1" in
fi
echo "@revision@"
;;
--configuration-revision)
if [[ "@configurationRevision@" =~ "@" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of awful, but probably fine for now. I think nixos-version would make a good candidate for __structuredAttrs once #175649 lands in master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also did not particularly like it - I am happy to take a look into __structuredAttrs - should this included in this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's fine. __structuredAttrs wouldn't really help anyway since the structured attrs are only available at build time.

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 3, 2023
miallo added 2 commits January 3, 2023 20:40
`nixos-version --configuration-revision` will show the
configurationRevision.
@miallo miallo force-pushed the nixos-version-configuration-revision branch from 6530fbc to 3b54566 Compare January 3, 2023 19:40
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Jan 3, 2023
@miallo
Copy link
Contributor Author

miallo commented Jan 12, 2023

@RaitoBezarius @ncfavier Do you know who can merge this? Apart from commits by Eelco, the earliest thing apart from treewide shellcheck/shebang changes in this file are from 2016, so I don't really know who to ping...

@ncfavier ncfavier merged commit 7e1cf49 into NixOS:master Jan 12, 2023
@miallo miallo deleted the nixos-version-configuration-revision branch January 12, 2023 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants