Provide flake's current commit message in self.sourceInfo
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 17.7k
- Forks
- 2k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 76
Description
Is your feature request related to a problem?
It would be great if one could access the current commit message of the flake. The self.sourceInfo.*Rev are great, but for things like the boot menu or other version identifiers consumed by humans, a commit message would be much more readable.
Proposed solution
New self.sourceInfo string attributes:
commitTitle: first line of the current flake commitcommitMsg: full commit message, possibly multiple lines
If necessary, the same dirty* variants for dirty flake trees.
Alternative solutions
There are partial workarounds to this, that are rather impure and require external setup:
- using a git hook to write the commit message to file, then read it with nix: https://discourse.nixos.org/t/cannot-access-commit-message-from-inside-build-sandbox/59138/9
- set
system.nixos.labelor theNIXOS_LABELenvvar: https://www.reddit.com/r/NixOS/comments/xi7gke/nixos_boot_menu_entries_based_on_current_git/
Additional context
Checklist
- checked latest Nix manual (source)
- checked open feature issues and pull requests for possible duplicates
Add 👍 to issues you find important.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the latest Nix manual and the existing self.sourceInfo.*Rev attributes to understand how flake source metadata is exposed. Define the behavior of commitTitle and commitMsg, including whether dirty variants are required, then verify that the attributes provide the current commit information for human-readable identifiers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100