We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
nixos
1 parent 93c1a94 commit 12b132dCopy full SHA for 12b132d
src/bootstrap/native.rs
@@ -217,12 +217,13 @@ fn fix_bin_or_dylib(builder: &Builder<'_>, fname: &Path) {
217
if !builder.config.patch_binaries_for_nix {
218
// Use `/etc/os-release` instead of `/etc/NIXOS`.
219
// The latter one does not exist on NixOS when using tmpfs as root.
220
+ const NIX_IDS: &[&str] = &["ID=nixos", "ID='nixos'", "ID=\"nixos\""];
221
let os_release = match File::open("/etc/os-release") {
222
Err(e) if e.kind() == ErrorKind::NotFound => return,
223
Err(e) => panic!("failed to access /etc/os-release: {}", e),
224
Ok(f) => f,
225
};
- if !BufReader::new(os_release).lines().any(|l| t!(l).trim() == "ID=nixos") {
226
+ if !BufReader::new(os_release).lines().any(|l| NIX_IDS.contains(&t!(l).trim())) {
227
return;
228
}
229
if Path::new("/lib").exists() {
0 commit comments