-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: add flake and use for CI environment
- Loading branch information
Showing
10 changed files
with
369 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# shellcheck shell=bash | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ lib | ||
, buildGoModule | ||
, nix-gitignore | ||
, installShellFiles | ||
, makeWrapper | ||
, bash | ||
, coreutils | ||
, git | ||
, pandoc | ||
, commit ? null | ||
}: | ||
|
||
let | ||
pname = "gg-scm"; | ||
version = "1.3.0"; | ||
in buildGoModule { | ||
inherit pname version; | ||
|
||
src = let | ||
root = ./.; | ||
patterns = nix-gitignore.withGitignoreFile extraIgnores root; | ||
extraIgnores = [ ".github" ".vscode" "*.nix" "flake.lock" ]; | ||
in builtins.path { | ||
name = "${pname}-source"; | ||
path = root; | ||
filter = nix-gitignore.gitignoreFilterPure (_: _: true) patterns root; | ||
}; | ||
postPatch = '' | ||
substituteInPlace cmd/gg/editor_unix.go \ | ||
--replace /bin/sh ${bash}/bin/sh | ||
''; | ||
subPackages = [ "cmd/gg" ]; | ||
ldflags = [ | ||
"-s" "-w" | ||
"-X" "main.versionInfo=${version}" | ||
] ++ lib.lists.optional (!builtins.isNull commit) [ | ||
"-X" "main.buildCommit=${commit}" | ||
]; | ||
|
||
vendorHash = "sha256-2z3PdyJ2xq4R2uuwYreff2G/ZNgsPoFZ9UeQ0Ly3KhU="; | ||
|
||
nativeBuildInputs = [ pandoc installShellFiles makeWrapper ]; | ||
nativeCheckInputs = [ bash coreutils git ]; | ||
buildInputs = [ bash git ]; | ||
|
||
postBuild = '' | ||
pandoc --standalone --to man misc/gg.1.md -o misc/gg.1 | ||
''; | ||
|
||
postInstall = '' | ||
wrapProgram $out/bin/gg --suffix PATH : ${git}/bin | ||
installManPage misc/gg.1 | ||
installShellCompletion --cmd gg \ | ||
--bash misc/gg.bash \ | ||
--zsh misc/_gg.zsh | ||
''; | ||
|
||
meta = with lib; { | ||
mainProgram = "gg"; | ||
description = "Git with less typing"; | ||
longDescription = '' | ||
gg is an alternative command-line interface for Git heavily inspired by Mercurial. | ||
It's designed for less typing in common workflows, | ||
making Git easier to use for both novices and advanced users alike. | ||
''; | ||
homepage = "https://gg-scm.io/"; | ||
changelog = "https://github.com/gg-scm/gg/blob/v${version}/CHANGELOG.md"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ zombiezen ]; | ||
}; | ||
} |
Oops, something went wrong.