Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork227
Add a Nix Flake as a build system#1605
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This adds a Nix flake which provides many outputs that can be built with'nix build'. The main outputs that can be built are:.#kiwiirc .#kiwiirc_distributeStatic.#webircgateway .#kiwiirc-desktopFor example, running `nix build .#kiwiirc` will produce a result:❯ nix build .#kiwiirc_distributeStatic❯ ls result/f66bb623-kiwiirc_darwin_amd64.zip f66bb623-kiwiirc_linux_armel.zipf66bb623-kiwiirc_darwin_arm64.zip f66bb623-kiwiirc_linux_armhf.zipf66bb623-kiwiirc_linux_386.zip f66bb623-kiwiirc_linux_riscv64.zipf66bb623-kiwiirc_linux_amd64.zip f66bb623-kiwiirc_windows_386.zipf66bb623-kiwiirc_linux_arm64.zip f66bb623-kiwiirc_windows_amd64.zip❯ nix build .#kiwiirc❯ ls result/www/index.html LICENSE staticCo-authored-by: DieracDelta <justin@restivo.me>Co-authored-by: Malte <3236302+malte-christian@users.noreply.github.com>Co-authored-by: Las Safin <me@las.rs>
Testing this PR can be done on any Linux distribution, or on macOS, or on the WSL1/2 if you're running Windows. Simply install Nix:
That will work in WSL1/2, macOS or on any Linux distribution. If this still scares you, you can use Docker to run Nix and test the majority of this PR. Just know that this is not necessary, and I encourage you not to attempt to use Docker/Github Actions to perform CI with Nix, since you will receive none of the caching benefits that Nix provides.
|
MatthewCroughan commentedJul 28, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ItsOnlyBinary it has been almost a year since we last spoke about this, but it'd be great if you could review it and consider using Nix. The Summer of Nix 2021 was the reason I created this, as NLNet/NGI are packaging various open source projects using Nix, so that they meet standards of long-term reproducibility. If there's been any advancements to Kiwiirc's packaging that are not taken into account by this PR, let me know and I'll add those outputs that are missing, since the Summer of Nix 2022 is now active and I'm looking back on the previous year of work 😄 |
Uh oh!
There was an error while loading.Please reload this page.
This adds a Nix flake which provides many outputs that can be built with
nix build. The main outputs that can be built are:For example, running
nix build .#kiwiircwill produce a result:For example, users may now run
nix build github:kiwiirc/kiwiirc#kiwiirc-desktopto build the desktop client from source, reproducibly, on any Linux machine withnixavailable.nixcan be used on any Linux distribution.The log of work done to produce this is herengi-nix#2
Nix builds are reproducible and deterministic. They do not use the host's environment for any reason, as they are sandboxed. A build on my machine will result in the same hash on your machine, as on another machine every time, since all inputs are controlled. This is the goal, and it is successful at this in the majority of cases. There are some exceptions with Java and reading system time, but issues like these are easily identified and worked around.
The Nix thesis can be read here:
https://edolstra.github.io/pubs/phd-thesis.pdf
Co-authored-by: DieracDeltajustin@restivo.me
Co-authored-by: Malte3236302+malte-christian@users.noreply.github.com
Co-authored-by: Las Safinme@las.rs