MilesCranmer / rip2

A safe and ergonomic alternative to rm
GNU General Public License v3.0
27 stars 1 forks source link

Add nix flake #36

Closed kanielrkirby closed 1 month ago

kanielrkirby commented 1 month ago

Addresses #35.

kanielrkirby commented 1 month ago

Added a test in the GH workflow, let me know if it needs tweaking (as I'm very very not good at workflows lol)

kanielrkirby commented 1 month ago

@MilesCranmer Should all be good, let me know if there's any other fixes! Learned a lot about how Nix files are integrated in real world scenarios here, now I can add them to my own! :p

kanielrkirby commented 1 month ago

Also am sorry for that horribly named commit message, that's my bad. I could have sworn I split them up haha.

MilesCranmer commented 1 month ago

Seems like it's not being installed to that dir?

MilesCranmer commented 1 month ago

Also I just realised something else.

  • Added a default.nix using flake-compat for compatibility to non-flake setups.

It sounds like default.nix is a different build file entirely than the flake one? If so we should probably have another test for that (or just delete it)

kanielrkirby commented 1 month ago

Also I just realised something else.

  • Added a default.nix using flake-compat for compatibility to non-flake setups.

It sounds like default.nix is a different build file entirely than the flake one? If so we should probably have another test for that (or just delete it)

Happy to add a test for it if you still think it's necessary, but two things first:

  1. default.nix pulls it's source of truth completely from the flake through a compatibility layer (flake-compat), so if it works, there's almost no world where flake.nix doesn't work, since it's just iterating through every node in the flake.lock / flake.nix, and manually handling it.
  2. If the build wasn't going to work for whatever reason for the flake.nix, the flake-checker would fail.

Definitely can still add a test for it separately if you think it's worth it, just wanted to check first.

kanielrkirby commented 1 month ago

Seems like it's not being installed to that dir?

Also interesting, I'll have to look into that, that's where it should be building to.

kanielrkirby commented 1 month ago

Ohhhh, yeah I ran the wrong command, that's the flake command. It's supposed to be nix-build not nix build. One second.

MilesCranmer commented 1 month ago

My question is more so: if there were any typos in any of SHAs or URLs over all of the nix files, would I have a way of knowing? (Since I’m new to nix, I think it’s good if the test coverage is complete here)

Maybe all the files are already used by that test but just want to make sure. (I thought the default.nix might be for something else)

MilesCranmer commented 1 month ago

Oh I think the issue was the CI was executing rip2 but the binary name is actually just rip. Fixed it

koalazub commented 1 month ago

My question is more so: if there were any typos in any of SHAs or URLs over all of the nix files, would I have a way of knowing? (Since I’m new to nix, I think it’s good if the test coverage is complete here)

If the SHA is incorrect it'll fail with a

Wanted Got

Kind of error. It won't actually succeed if the SHA is incorrect

MilesCranmer commented 1 month ago

Awesome, thanks

kanielrkirby commented 1 month ago

Awesome! It's official! Lol.

❯ nix shell "github:MilesCranmer/rip2"
❯ rip --version
rip 0.8.0

Also, appreciate both @MilesCranmer and @koalazub for taking the time!

MilesCranmer commented 1 month ago

Awesome! Thanks for the PR