-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Flake #155
base: main
Are you sure you want to change the base?
Flake #155
Conversation
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.
Can you elaborate on the cargo2nix? It seems like kinda standard nixpkgs package via buildRustPackage
(https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md) to me?
# NOTE: requires impure because of nixgl | ||
use flake . --impure |
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.
Proposing to make a conditional check that uses impure on non-nixos setup and pure on nixos to keep the environment reproducible or some other management to avoid the impurity e.g. https://github.com/nix-community/nixGL?tab=readme-ov-file#install-nixgl which seems to install nixGL in the user profile, but i don't have much experience with it.
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.
nixgl cannot be used purely right now - see this discussion nix-community/nixGL#90
the link you posted also suggests to use --impure
i also want it to be pure but i found no way of doing this right now
for some reason unknown to me nixgl uses builtins.currentTime
which cannot be used purely
if you know of a way to make it work purely id be happy to make a change
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 don't have a better solution atm. worst case if you are going to merge it with the --impure
flag then i would suggest making an issue about it in verso for long-term tracking.
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.
Well FWIW one way that comes to mind rn, but feels a bit hacky is to declaratively make a shell application via writeShellApplication
alike how i do tasks in nixium https://github.com/NiXium-org/NiXium/tree/central/tasks/administration/build as the way i understand it is that the script creation happens during nix's eval phase that then executes the created script with it's environment outside of nix's build envrionment to have the ability to use impure things, but i literally looked into nixgl yesterday and didn't have time to test if this is a good solution yet
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.
#157 added one rn so i dont forget
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.
sry im not smart enough to understand everything ur saying
id like to merge it impurely right now as its better than just a shell.nix
imo but let someone smarter take care of the purity - or myself when i learn more about nix
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.
it's okay everyone sucks at nix :D I try to look into it as i am researching nixGL myself rn and if i find a way i try to submit it here as well
I use it to speed up development in personal projects. In summary, if I was adding |
Fair |
Hey, FYI, we probably will only support Flatpak for now.
I think we can revisit this again once nix-community/nixGL#90 is resolved as you mentioned in #157 |
That is not a blocking issue that would prevent functionality and only affects non-NixOS systems.. it's kinda a nice to have thing to make the shell more reproducible. |
I was going to add a package into
nixpkgs
for this but I realized the build step is a bit more complex than i liked so I went first to make this a flake and add a package via eithercargo2nix
ornixpkgs
. This repo uses nix anyway and flakes are just a bit nicer way to setup a dev environment than justshell.nix
IMO.I am able to enter the shell but building with cargo gives me errors. It's rather long so I wont be posting that here.
I was not able to disable 32 bits for nixGL so I'd need a bit of help on that. I also replaced
rustup
withrustc
andcargo
since they're just faster to setup however that might lead to some issues.