I am writing an operating system in rust, and I am recently working on NixOS. But when I was trying to run it, I found that the [target.'cfg(target_os = "none")'] section seems to be ignored by cargo, because limine won't try to find the .dynamic section if cargo doesn't ignore that part, To be make sure it was not my problem, I switched back to Arch Linux and tried again. To my surprise, it worked well. So why did cargo ignore some part of .cargo/config.toml on NixOS? Has anyone else experienced any problem similar to this?
I have no experience with NixOS, but the obvious explanation for such a situation would be if your NixOS environment has one or more Cargo configuration environment variables set and your Arch environment does not. Environment variables take precedence over .cargo/config.toml.
1 Like
So it will also ignore the flags even if the environment variable is empty?
I have solved the problem, thanks a lot!
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.