djanatyn / ssbm-nix

Nix expressions for Super Smash Bros. Melee players.
31 stars 17 forks source link

Try to fix build with new nixpkgs-unstable. #29

Closed jumper149 closed 1 year ago

jumper149 commented 1 year ago

This compiles :)

djanatyn commented 1 year ago

Thank you, I'm building now!

❯ nix build github:jumper149/ssbm-nix/update-nixpkgs#slippi-netplay -o jumper149-ssbm-nix
warning: ignoring substitute for '/nix/store/pd0r1j16ijay0r0490118lrggcgapw3s-source' from 'https://ssbm-nix.cachix.org', as it's not signed by any of the keys in 'trusted-public-keys'
[1/2/3 built, 472 copied (1748.2/1750.1 MiB), 397.5 MiB DL] building slippi-ishiiruka-2.5.2-netplay (buildPhase): [ 76%] Building CXX object Source/Core/Core/CMakeFiles/core.dir/HW/SI_DeviceKeyboard.cpp.o

And just tried it out after compiling, works great on my system!


I had a quick question - we use callPackage (from nixpkgs) to build our derivations: https://github.com/djanatyn/ssbm-nix/blob/74c0c466435f9e134e6f4e22e6c5a26d80e7fa53/overlay.nix#L18

This means we specify our input names, and have to change them between nixpkgs revisions: https://github.com/djanatyn/ssbm-nix/blob/74c0c466435f9e134e6f4e22e6c5a26d80e7fa53/slippi/default.nix#L1

We also specify a nixpkgs version (currently nixos-22.05): https://github.com/djanatyn/ssbm-nix/blob/74c0c466435f9e134e6f4e22e6c5a26d80e7fa53/flake.nix#L4

A consequence of using callPackage is that we have to keep our derivation's inputs matching the conventions in our active nixpkgs revision (as I think you encountered, which led to this change!)

I have some open questions about how this interacts with the overlay we export as well.

Anyway, to get to my point: I'd love to bring in these changes. Do you think we should also update inputs.nixpkgs.url to be nixos-unstable?

I think that might be the best "supported" version of nixpkgs to pull in, and it would be nice to say in the README, "we explicitly support nixos-unstable, but you can use other revisions like this..."

I'd also like to update our flake.lock, which is currently pointing to a very old nixpkgs revision from 2020:

❯ nix flake metadata github:djanatyn/ssbm-nix
Resolved URL:  github:djanatyn/ssbm-nix
Locked URL:    github:djanatyn/ssbm-nix/74c0c466435f9e134e6f4e22e6c5a26d80e7fa53
Description:   Nix expressions for Super Smash Bros. Melee players.
Path:          /nix/store/mdjkphc5fn4r2rzjqrwg0dhg2wkmlx0v-source
Revision:      74c0c466435f9e134e6f4e22e6c5a26d80e7fa53
Last modified: 2022-09-15 14:02:48
Inputs:
├───nix: github:NixOS/nix/8a2ce0f455da32bc20978e68c0aad9efb4560abc
│   ├───lowdown-src: github:kristapsdz/lowdown/1705b4a26fbf065d9574dce47a94e8c7c79e052f
│   └───nixpkgs: github:NixOS/nixpkgs/ad0d20345219790533ebe06571f82ed6b034db31
...
❯ nix flake metadata github:NixOS/nixpkgs/ad0d20345219790533ebe06571f82ed6b034db31 | grep 'Last modified'
Last modified: 2020-10-14 15:09:56

Thanks again for these changes, I'm approving them. No worries if you don't have any thoughts on these issues, just wanted to ask!

djanatyn commented 1 year ago

And once again, thanks for the contribution :)

jumper149 commented 1 year ago

Do you think we should also update inputs.nixpkgs.url to be nixos-unstable?

I personally would choose nixos-unstable or nixpkgs-unstable over nixos-22.05.


I am not sure about callPackage.