-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
[RFC] nixos-version: Add lsb_release compatibility #23175
Conversation
No objection here; I'm not following NixOS but if that old script was remotely useful then I'm glad I shared it. |
👍 all parameters work Distributor ID: otherwise |
Requires NixOS#23190
fd69eba
to
39d13ea
Compare
@davidak Fixed the capitalization, thanks 😄 Currently this requires #23190 but it could be done without that PR as well (just thought it would make more sense to add Since the |
@@ -115,16 +115,14 @@ if [[ "$all" = "1" ]] || [[ "$revision" = "1" ]]; then | |||
fi | |||
# TODO: echo "@nixosRevision@"? | |||
# Revision comes from: VERSION="16.09.git.effc189 (Flounder)" -> effc189 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also update the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks 😄
@primeos what's the status of this? this is still needed! |
@davidak Sorry for my delayed response. IIRC this was working as expected and I assume the merge conflicts would be easy to resolve - from the technical side it shouldn't be a problem to finish this PR. However, I do not think that we do actually need this anymore due to So IMO we should re-evaluate if we do still need this, e.g.:
And also if we should use the E.g. http://0pointer.de/blog/projects/os-release.html states the following:
|
@primeos it would be good to have this installed by default, so programs can detect the OS, for example for telemetry collection. I know 2 where it is needed:
We should at least have it as a package. |
@davidak Thanks for the feedback and linking the PRs.
Oh, I forgot that the
In that case I would propose that we replace the current Does that sound like a good idea? E.g. Debian apparently also uses a custom Python script: https://salsa.debian.org/debian/lsb/blob/debian/master/lsb_release |
I think the most elegant solution would be a universal lsb_release script, that works on any linux distribution by trying out different release files. Then our package works also on other distros. But they probably have their own package. So the priority should be to fix the problems on NixOS by providing a working lsb_release. |
Would be easy to implement if they would have the same format, but this is probably not the case and the other files are probably not standardised (but I haven't checked that). It might therefore be better to focus on
I've opened #64258 and will close this PR for now. |
Motivation for this change
See the discussion at #22729.
BUGS/TODOS:
that changed(only if build from a git checkout), now it's the abbreviated commit hash)lsb_release
andnixos-version
now both keep their default outputlsb_release
compatibility (I tried to stick to the specification and thelsb_release
binary from Debian (wheezy)).The script is based on this great public-domain Gist from @skx (thanks 😄 - I hope it's ok that I mention you).
cc #22729 @grahamc @davidak @edolstra @eduarrrd
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)