Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ GLOBAL OPTIONS:
brew install carpeliam/brew/gitshorty
```

### Via Nix
If you have Nix with flakes enabled, you can install gitshorty in several ways:

```sh
# Install to your profile
nix profile install github:carpeliam/gitshorty

# Run without installing
nix run github:carpeliam/gitshorty -- --help

# Use in a flake-based project (add to flake.nix inputs)
inputs.gitshorty.url = "github:carpeliam/gitshorty";
```

### From source
The source is at least compatible with Go v1.23.1, and can be built as follows:
```
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
description = "A Shortcut Command-Line tool that works within git branches";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = {
default = self.packages.${system}.gitshorty;

gitshorty = pkgs.buildGoModule {
pname = "gitshorty";
version = "0.0.4";

src = ./.;

vendorHash = "sha256-/QFFgQinroq0e6dBmRwkGmPP1p8CVtOgQXx9PJXooiM=";

# The binary is named "sc"
ldflags = [ "-s" "-w" ];

# Rename the binary from gitshorty to sc
postInstall = ''
mv $out/bin/gitshorty $out/bin/sc
'';

meta = with pkgs.lib; {
description = "A Shortcut Command-Line tool that works within git branches";
homepage = "https://github.com/carpeliam/gitshorty";
license = licenses.mit;
maintainers = [ ];
mainProgram = "sc";
};
};
};

# Development shell
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
];
};
}
);
}