-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add nix-shell to allow native build on NixOS #2333
Conversation
I feel like shell.nix should be at the root of the filesystem instead of in documents/build-nixos. That, and the README.md in that folder should be moved to to documents/ and renamed to building-nix.md |
I think you're right about moving shell.nix to root, initially I though it was not a great idea to add files to root that's all. |
I can't seem to initialize this shell, it returns a 404 error when attempting to fetch the Vulkan-Utility-Libraries-1.4.305 tarball.
Output of
|
@aatmunbaxi that's because sdk version is 1.4.304.0 (and nixpkgs repo uses sdk version https://github.com/nixos/nixpkgs/blob/master/pkgs/development/libraries/vulkan-headers/default.nix#L26) , 1.4.305 is not the one (https://github.com/KhronosGroup/Vulkan-Tools?tab=readme-ov-file#version-tagging-scheme). This project requires 1.4.305 (https://github.com/shadps4-emu/shadPS4/blob/main/CMakeLists.txt#L153) so it makes sense to grab this one, but 1.4.304.0 would also work (I have tested it). |
Question, how often does the NixOS unstable branch get updated? That PR already got merged so it should be possible to use 1.4.304 without building it from source, no? |
That's the unknown part unfortunately, all I know is that unstable channel get's updated when somebody with commit access pushes changes to master. The PR I've mentioned got merged to stagging branch and not to master, because of high amount of dependencies. So according to me and to https://nixos.wiki/wiki/Nix_channels we have no answer to this question. |
I think it would be better to wait until that happens to use the packages available in NixOS staging instead of building the Vulkan utility libraries from source, it saves us more time and avoids issues like the error 404 one mentioned above (I'm having the same issue). |
NixOS maintainer here. Staging updates AFAIK go into staging-next, and then merged into the master branch. The current staging-next PR is NixOS/nixpkgs#377253 |
Ookay, that's actually helpful, in that case in the next two weeks we would probably get new vulkan packages which would solve the problem. Alrighty let's wait until then. |
You should probably turn this PR into a draft in the meantime. |
Only concern here is that I don't think a lot of frequent contributors are Nix users so the build file could drift as changes are made. So I guess if you're okay with that and can keep it maintained it might be fine. |
Sure that's the plan and the possible changes shouldn't be very complex, if I was able to build a working shell - I am pretty sure there're bunch of people in the community who can do it even better. |
Ookay, so the PR in nixpkgs got merged and I have changed shell.nix to use official unstable channel, so this PR is ready to be merged |
it fails the reuse , you need to exclude it in reuse.toml file |
I've added a license header to shell.nix since it supports comments, so no need to exclude it |
This PR adds nix-shell that will allow to build shadPS4 on nixos natively. While we can use distrobox, native approach is much better since it allows us to run it on nix-machines without the need to install docker and it allows to reproduce builds without worrying about different versions of dependencies.
Tested on x86_64