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

Add nix flake support #57

Closed
wants to merge 1 commit into from

Conversation

ThibaultLemaire
Copy link

If you have nix installed with flakes enabled, you can get a shell with ntfs2btrfs available like so:

nix shell github:ThibaultLemaire/ntfs2btrfs

Nix automatically downloads all required dependencies then builds ntfs2btrfs the first time you run this command. (Works on any Linux system.)

@maharmstone
Copy link
Owner

Is this such a good idea? Normally it's up to the package maintainer rather than the developer to do stuff like this. And I'm not aware of any other distro that requires changes to be made to the upstream repo.

@ThibaultLemaire
Copy link
Author

It's definitely not required, just convenience. I don't know much about gentoo, but I thought so was the .ebuild included in this repo.

I can move this to a dedicated repo if you prefer. I just have to change the

src = self;

line to something like

src = fetchFromGithub {
  owner = "mharmstone";
  repo = "ntfs2btrfs";
};

Nixos is a Linux distribution, but nix is a standalone package manager.
You can use it alongside your regular package manager on any distro (and even on macOS I hear).
The idea behind nix flakes is to decentralise repositories, a bit like how you can specify dependencies by a git url in Go or Rust.

So, technically, ntfs2btrfs is already packaged for nix on my fork, which is why I wrote ThibaultLemaire/ntfs2btrfs in the example command above, because it already works.

Having the flake here also lets people run

nix develop

and get a development shell furnished with all the required dependencies to build and contribute to ntfs2btrfs (like libfmt). And thanks to the flake.lock file, we can be sure everyone gets the same dev env. ("Works on my machine", means "works on your machine too")

I understand that you don't want to maintain yet another package though, especially if you don't use it.

So it's really your call: I can either maintain that here, or move it to a dedicated repo (or just leave it on my fork if I'm too lazy). Both are fine by me.

@maharmstone
Copy link
Owner

Yeah, sorry. I'm sympathetic, it looks really cool, but I don't want to accept something I wouldn't be testing. It'd be different if I used Nix myself.

The Gentoo ebuild's only there because it seems impossible for upstream to accept new packages at the moment - https://bugs.gentoo.org/715532 has been open two years now...

@maharmstone maharmstone closed this Sep 7, 2022
@ThibaultLemaire
Copy link
Author

Would you like to add a link to the readme along with the other packages though? I can open another PR

(You can say no for the same reasons)

@maharmstone
Copy link
Owner

That's fine, go for it

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.

None yet

2 participants