Open
Conversation
Because it's funny, I have my /etc/os-release customized to use a `NAME` that's not `NixOS`. This is something that's easy to do by simply setting the options that control the stuff in os-release: https://github.com/NixOS/nixpkgs/blob/527be1432109cfaf305987865bc17cc908e8e77a/nixos/modules/misc/version.nix#L121-L161 In fact, there's an entire library dedicated to making silly customizatoins like this: https://github.com/yunfachi/denix This changes the nixos detection code to look for /run/current-system, which is present on all NixOS systems regardless of configuration, and is importantly _not_ present when using Nix on non-NixOS.
Author
|
Also added NixOS EOL data and vulnix support (#1509) |
Member
|
Thanks for your work. Kind request: please don't add all changes to one pull request, otherwise it becomes very hard to merge them upon reviewing. |
Author
Sounds good; I'll cherry-pick each of the commits into their own branches. |
Author
|
This has been tested on my own system and it correctly identifies it as NixOS despite the customized |
Author
|
Bump! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because it's funny, I have my /etc/os-release customized to use a
NAMEthat's notNixOS. This is something that's easy to do by simply setting the options that control the stuff in os-release:https://github.com/NixOS/nixpkgs/blob/527be1432109cfaf305987865bc17cc908e8e77a/nixos/modules/misc/version.nix#L121-L161
In fact, there's an entire library dedicated to making silly customizations like this: https://github.com/yunfachi/denix
This changes the NixOS detection code to look for /run/current-system, which is present on all NixOS systems regardless of configuration, and is importantly not present when using Nix on non-NixOS.