Skip to content

Add Nix flake - #2

Open
mattwynne wants to merge 1 commit into
carpeliam:mainfrom
mattwynne:add-nix-flake
Open

Add Nix flake#2
mattwynne wants to merge 1 commit into
carpeliam:mainfrom
mattwynne:add-nix-flake

Conversation

@mattwynne

Copy link
Copy Markdown

This adds a flake.nix that allows users to install gitshorty using Nix flakes. Users can now:

  • Install directly: nix profile install github:carpeliam/gitshorty
  • Use in flake-based projects as an input
  • Run without installing: nix run github:carpeliam/gitshorty

The flake builds the project using buildGoModule and renames the binary from gitshorty to sc to match the project's conventions.

Also updates README.md with installation instructions for Nix users.

This adds a flake.nix that allows users to install gitshorty using Nix
flakes. Users can now:
- Install directly: nix profile install github:carpeliam/gitshorty
- Use in flake-based projects as an input
- Run without installing: nix run github:carpeliam/gitshorty

The flake builds the project using `buildGoModule` and renames
the binary from `gitshorty` to `sc` to match the project's conventions.

Also updates README.md with installation instructions for Nix users.
@carpeliam

Copy link
Copy Markdown
Owner

Thanks @mattwynne! I'm not too familiar with the nix ecosystem, so I have a few questions. Is the SHA attached to the HEAD commit, or the commit at tag v0.0.4? In other words, if I push a new commit that's not ready for release, what does nix do? And, do you recommend any processes for keeping the flake up to date as new releases come out? I don't think having GHA in place should be a precursor to getting this merged, but I'd like to better understand the complexity.

@carpeliam

Copy link
Copy Markdown
Owner

After looking around a bit, it looks like the vendor hash follows my dependencies, but I just merged a dependabot update of some dependencies. Does that mean this is already out of date? From a cursory glance, it looks like the best way to update the flake is to use nix itself; if that's the case, I'll have to look into using GHA to keep the flake updated, as I'd like to avoid installing nix on my personal machine.

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