-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
58 lines (45 loc) · 1.42 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
let
pkgs = import (import ./nix/pkgs.nix) {};
in
{
buildGoModule ? pkgs.buildGoModule
, nix-gitignore ? pkgs.nix-gitignore
, version ? "dev"
, fzf ? pkgs.fzf
, git ? pkgs.git
, tmux ? pkgs.tmux
, procps ? pkgs.procps
, installShellFiles ? pkgs.installShellFiles
, lib ? pkgs.lib
, makeWrapper ? pkgs.makeWrapper
}:
buildGoModule rec {
inherit version;
pname = "swm";
src = nix-gitignore.gitignoreSource [ ".git" ".envrc" ".travis.yml" ".gitignore" ] ./.;
vendorSha256 = null;
ldflags = "-X=github.com/kalbasit/swm/cmd.version=${version}";
nativeBuildInputs = [ fzf git tmux procps installShellFiles makeWrapper ];
postInstall = ''
for shell in bash zsh fish; do
$out/bin/swm auto-complete $shell > swm.$shell
installShellCompletion swm.$shell
done
$out/bin/swm gen-doc man --path ./man
installManPage man/*.7
wrapProgram $out/bin/swm --prefix PATH : ${lib.makeBinPath [ fzf git tmux procps ]}
'';
doCheck = true;
preCheck = ''
export HOME=$NIX_BUILD_TOP/home
mkdir -p $HOME
git config --global user.email "nix-test@example.com"
git config --global user.name "Nix Test"
'';
meta = with lib; {
homepage = "https://github.com/kalbasit/swm";
description = "swm (Story-based Workflow Manager) is a Tmux session manager specifically designed for Story-based development workflow";
license = licenses.mit;
maintainers = [ maintainers.kalbasit ];
};
}