-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
88 lines (78 loc) · 2.4 KB
/
flake.nix
File metadata and controls
88 lines (78 loc) · 2.4 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
{
description = "vibe - Git worktree helper CLI";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
version = "1.4.2";
# Platform-specific binary names and SHA-256 hashes
platforms = {
x86_64-linux = {
artifact = "vibe-linux-x64";
hash = "sha256-gAuES9Dtw4/5ttS9Z4kkXzc/0XyG2bEQ/cVHEV9q3UI=";
};
aarch64-linux = {
artifact = "vibe-linux-arm64";
hash = "sha256-WHTNkCmYEcFpfCA+n4Pvj1BhLUct8h0Zo0gnSSlH5ag=";
};
x86_64-darwin = {
artifact = "vibe-darwin-x64";
hash = "sha256-w6PENTb0UJDtXrQW+NtDspxylCcWItfo9Z5FWbGVigg=";
};
aarch64-darwin = {
artifact = "vibe-darwin-arm64";
hash = "sha256-klFwbvkIaojRNRhMlWNp+K5y25I1zTTWIn7gp/OFcus=";
};
};
in
flake-utils.lib.eachSystem (builtins.attrNames platforms) (system:
let
pkgs = nixpkgs.legacyPackages.${system};
platformInfo = platforms.${system};
isLinux = pkgs.lib.hasSuffix "-linux" system;
in
{
packages.default = pkgs.stdenv.mkDerivation {
pname = "vibe";
inherit version;
src = pkgs.fetchurl {
url = "https://github.com/kexi/vibe/releases/download/v${version}/${platformInfo.artifact}";
hash = platformInfo.hash;
};
dontUnpack = true;
nativeBuildInputs = pkgs.lib.optionals isLinux [
pkgs.autoPatchelfHook
];
buildInputs = pkgs.lib.optionals isLinux [
pkgs.stdenv.cc.cc.lib
];
installPhase = ''
install -Dm755 $src $out/bin/vibe
'';
meta = with pkgs.lib; {
description = "Git worktree helper CLI";
homepage = "https://github.com/kexi/vibe";
license = licenses.asl20;
platforms = builtins.attrNames platforms;
mainProgram = "vibe";
};
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
bun
nodejs
nodePackages.pnpm
rustc
cargo
git
];
};
}
) // {
overlays.default = final: prev: {
vibe = self.packages.${final.system}.default;
};
};
}