-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
75 lines (60 loc) · 1.76 KB
/
flake.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
rec {
devShell = pkgs.mkShellNoCC {
name = "go_1.18";
buildInputs = with pkgs; [
go_1_18
gopls
gotools
golint
(python3.pkgs.grip.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "joeyespo";
repo = "grip";
rev = "v4.6.1";
sha256 = "sha256-CHL2dy0H/i0pLo653F7aUHFvZHTeZA6jC/rwn1KrEW4=";
};
patches = [ ];
}))
];
};
packages.jutge = pkgs.buildGo118Module {
pname = "jutge";
version = "0.3.1";
src = ./.;
vendorSha256 = "sha256-xUwORIAWICnYOfApp8p5hBuaXwbzVVDOUtIPM9QATSI=";
buildInputs = [ pkgs.installShellFiles ];
postInstall = ''
cat <<EOF >jutge.fish
function __complete_jutge
set -lx COMP_LINE (commandline -cp)
test -z (commandline -ct)
and set COMP_LINE "$COMP_LINE "
$out/bin/jutge
end
complete -f -c jutge -a "(__complete_jutge)"
EOF
cat <<EOF >jutge.zsh
autoload -U +X bashcompinit && bashcompinit
complete -C $out/bin/jutge jutge
EOF
echo "complete -C $out/bin/jutge jutge" >jutge.bash
installShellCompletion --cmd jutge jutge.{bash,fish,zsh}
'';
};
defaultPackage = packages.jutge;
}
);
}