-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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/os-release: generate from attrset #162168
Conversation
Kinda, sorta related to RFC42. |
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.
I like it 👍
I have |
Couple of things here.
1. are you by chance creating /etc/NIXOS using tmpfiles? If so, instead of creating a link to /dev/null, you can use
the "f" command to create an empty file instead.
2. there is no reason that I can think of that /etc/NIXOS couldn't be a symlink though
3. the check for ID=nixos is definitely broken as there is nothing wrong with it being quoted
Can you confirm 1?
|
I was actually using |
You could also use:
environment.etc."NIXOS".text = "";
|
Yes, that should also work. It'll still create it as a symlink, but being symlinked to an actual file would allow the |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/veloren-airshipper-libegl-so-not-found/18225/8 |
Per https://www.freedesktop.org/software/systemd/man/os-release.html, > Variable assignment values must be enclosed in double or single quotes > if they include spaces, semicolons or other special characters outside > of A–Z, a–z, 0–9. (Assignments that do not include these special > characters may be enclosed in quotes too, but this is optional.) So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`. One of these is necessary between NixOS/nixpkgs#162168 and NixOS/nixpkgs#164068, but this seems more correct either way.
bootstrap.py: nixos check in /etc/os-release with quotes Per https://www.freedesktop.org/software/systemd/man/os-release.html, > Variable assignment values must be enclosed in double or single quotes > if they include spaces, semicolons or other special characters outside > of A–Z, a–z, 0–9. (Assignments that do not include these special > characters may be enclosed in quotes too, but this is optional.) So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`. One of these is necessary between NixOS/nixpkgs#162168 and NixOS/nixpkgs#164068, but this seems more correct either way.
bootstrap.py: nixos check in /etc/os-release with quotes Per https://www.freedesktop.org/software/systemd/man/os-release.html, > Variable assignment values must be enclosed in double or single quotes > if they include spaces, semicolons or other special characters outside > of A–Z, a–z, 0–9. (Assignments that do not include these special > characters may be enclosed in quotes too, but this is optional.) So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`. One of these is necessary between NixOS/nixpkgs#162168 and NixOS/nixpkgs#164068, but this seems more correct either way.
Motivation for this change
I've had this sitting around for ages - instead of interpolating a large string
in order to generate =/etc/os-release=, build it from an attribute set instead
which is less likely to be broken in case of changes.
Additionally, generate =/etc/lsb-release= for compatibility with older software.
The cost of doing this is a few hundred bytes, so it should be fairly
non-controversial.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes