Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add nix flake to package for NixOS #263

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mtahernia
Copy link

I added a Nix flake to package the LibreVNA-GUI for NixOS users.

@jankae
Copy link
Owner

jankae commented Jul 6, 2024

Hi, thank you for the PR. I am unfamiliar with NixOS and flake. Could you please explain why this is needed, how installation would work on NixOS and whether the files have to be at the root of the repository? (I would rather prefer adding a folder for packaging instead of cluttering root)

@jankae
Copy link
Owner

jankae commented Jul 22, 2024

This has been stale for a while. Any chance you can answer my questions? I am not against merging this, but would need to understand a bit more about it

@mtahernia
Copy link
Author

Hi, apologies for my late response

Nix is a package management system based on Nix's functional programming language.
You can find many resources about it online and from their official website.
NixOS is not as user-friendly as distributions such as Ubuntu, but once you overcome the learning curve, it is hard to use any other distribution.

Ideally, we should submit the package to nixpkgs to include it in Nix distribution. (I didn't due to unfamiliarity with the community and lack of time, but I will do at some point). The next best thing is to include a flake for Nix users.

Now for why it has to be in the root, it doesn't have to be, but having it at the root of the repo is more convenient.

Here are some possibilities:

At root of a branch

In my fork of LibreVNA, I have a branch called nixos-support where flake.nix and flake.lock are present at the root of the repository. Anyone with Nix can run the following command to build and run LibreVNA-GUI:

nix run github:mtahernia/LibreVNA/nixos-support

This will pull the repo and build it and run the software. (also can install with nix,...)

At root of the main branch

If the files were in the main branch, you can omit the branch and simply run

nix run github:jankae/LibreVNA

In the subdirectory of a branch

They can also be in a subdirectory. Imagine flake.nix and flake.lock are located in package/nix of a branch test_branch; then one can use the following:

nix run github:jankae/LibreVNA/test_branch?dir=package/nix

In a separate repo containing only the flake.nix and flake.lock

nix run github:jankae/LibreVNA-nix

I hope this answers your question.
Many thanks for your incredible work :)

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