Use Nix for reproducable building #78
Use Nix for reproducable building #78headblockhead wants to merge 1 commit intovanilla-wiiu:masterfrom
Conversation
|
Before I continue to work on this, would this be of interest to you, @itsmattkc? I don't want to invest too much time into a PR with no hope of getting merged. |
|
All my issues preventing me from making this work have now been resolved! I will hopefully be able to put some time into making a proper Nix flake for vanilla soon. |
|
Currently:
|
|
To work around the git clone for hostap, use There are still other build issues however, but it means no arbitrary network access is needed during build anymore. ihaveamac@41d856d#diff-16cddcd6b987528aee0e3d6930f04e9413e1e349c66d385fdc93290af456800dR78-R80 |
|
This is the build error: This can be disabled with: env.NIX_CFLAGS_COMPILE = "-Wno-format-security"; |
|
I hope you don't mind, but I used this as a base to put in my nur, with some updates made to adapt to changes made to the vanilla repo since 2024 (including removing most phases and some dependencies): https://github.com/ihaveamac/nur-packages/tree/staging/pkgs/vanilla ihaveamac/nur-packages@f84d79c I did this so that I could keep it easily up to date to experiment with on Steam Deck, without needing to manually add the flake to the repo. If this bothers you or you want to keep your original repo up to date then I will take it out. |
|
Why not make it an official nix package? |
|
Been a while since I've touched this - I'll work on a nixpkgs pr today, as vanilla appears to be a little more stable now. |
|
Also added to nixpkgs as NixOS/nixpkgs#479026. |
This PR adds files for building vanilla with the Nix build system.
Nix is
This PR adds a Nix Flake, which defines a set of dependencies and instructions on how to build Vanilla.
A flake in the Vanilla repository would allow Nix users to run vanilla with one command:
nix run github:vanilla-wiiu/vanilla.Nix could potentially replace Linux builds in the CI workflow to guarantee that CI-produced binaries are identical to locally-produced binaries, which could be useful for future issue diagnosis.
Finally, Nix build support would make it significantly easier for people running NixOS to run vanilla, as NixOS does not support generic dynamically-linked executables because it does not implement a typical FHS.
Please read through nix.dev for more on Nix and why it is useful if you have the time :)
To test:
To test this, install Nix from https://nixos.org/download/ and run
nix run github:headblockhead/vanillawhich will build and run vanilla using Nix.Alternatives:
Additionally, I am currently adding vanilla to nixpkgs, which is NixOS's equivalent to Arch's AUR, and will make a PR to note this in the README when I am done. However, this would make it my responsibility to maintain instead.