Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
MatthewCroughan wants to merge1 commit intokiwiirc:master
base:master
Choose a base branch
Loading
fromngi-nix:flake

Conversation

@MatthewCroughan
Copy link

@MatthewCroughanMatthewCroughan commentedOct 15, 2021
edited
Loading

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-desktop

For example, runningnix 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  static

For example, users may now runnix build github:kiwiirc/kiwiirc#kiwiirc-desktop to build the desktop client from source, reproducibly, on any Linux machine withnix available.nix can 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

duckspike, DieracDelta, inkpot-monkey, Shillos, alarsyo, MatthewCroughan, and MMesch reacted with thumbs up emoji
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>
@MatthewCroughan
Copy link
Author

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:

curl -L https://nixos.org/nix/install | sh

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.

  1. Get nix inside of a Docker container:
    docker run -it nixos/nix sh
  2. Once inside, get nix 2.4:
    nix-shell -p nixUnstable
  3. Test this PR:
    nix build github:ngi-nix/kiwiirc/flake#kiwiirc --experimental-features 'nix-command flakes'
    nix build github:ngi-nix/kiwiirc/flake#kiwiirc_distributeStatic --experimental-features 'nix-command flakes'

@MatthewCroughan
Copy link
Author

MatthewCroughan commentedJul 28, 2022
edited
Loading

@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 😄

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@MatthewCroughan

[8]ページ先頭

©2009-2025 Movatter.jp