Skip to content

Add Nix support#389

Merged
nab138 merged 1 commit intonab138:mainfrom
xerz-one:main
Apr 12, 2026
Merged

Add Nix support#389
nab138 merged 1 commit intonab138:mainfrom
xerz-one:main

Conversation

@xerz-one
Copy link
Copy Markdown
Contributor

@xerz-one xerz-one commented Apr 11, 2026

Provide support for the Nix package manager. The following targets are supported, with the mark emojis indicating code testing:

x86_64-linux
x86_64-darwin
aarch64-linux
aarch64-darwin

This is achieved using the Nixpkgs derivation builder for Rust, with the cargo-tauri hook for build support, as well as the community bun2nix hook for reproducible Bun dependency fetching. No hardcoded constants are involved, and in particular no hashes, patchfiles or additional lockfiles are needed, which allows the derivation to keep working over time with little to no maintenance.

The logic is contained within flake.nix, thus transforming the Git repo into a flake. The following are valid ways to use it with Nix:

  • Building and running the program in a single command: nix run github:nab138/iloader
    • The repo can, in turn, be added to the Nix registry (so that the latest version can be launched with e.g. nix run iloader)
  • Importing the repo into a NixOS configuration as a flake input, with the package being located at packages.${system}
  • Cloning the Git repo and using it as a traditional package source (with nix-{build,shell} and NIX_PATH) thanks to integration via flake-compat

Finally, the nix-systems pattern is used to allow users to easily import iLoader on arbitrary architectures, and there is treefmt-nix support for Nix styling with nixfmt.

@nab138
Copy link
Copy Markdown
Owner

nab138 commented Apr 12, 2026

I don't really know anything about nix so I have no idea if this is right or not, but it looks reasonable enough to me

@nab138 nab138 merged commit 6dfc136 into nab138:main Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants