Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
85 lines (70 loc) · 2.05 KB
/
Copy pathflake.nix
File metadata and controls
85 lines (70 loc) · 2.05 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
{
description = "A keyboard-driven WhatsApp client for the terminal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
forAllSystems =
callback:
nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
] (system: callback nixpkgs.legacyPackages.${system});
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
in
{
packages = forAllSystems (
pkgs:
let
inherit (pkgs) lib;
in
rec {
whatsrust-libgo = pkgs.buildGoModule {
pname = "whatsrust-libgo";
inherit version;
src = ./whatsrust/lib;
buildPhase = ''
runHook preBuild
go build \
-buildmode=c-archive \
-o libgo.a
runHook postBuild
'';
installPhase = ''
mkdir -p $out/lib
cp libgo.a $out/lib/
'';
vendorHash = "sha256-FyC60Cx+N8NV+TnNjFllTsN3Fv68aeiRsYY7/obyAYo=";
};
default = pkgs.rustPlatform.buildRustPackage (finalAttrs: {
pname = "wp-tui";
inherit version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
strictDeps = true;
__structuredAttrs = true;
preBuild = ''
export WHATSRUST_LIBGO=${whatsrust-libgo}/lib/libgo.a
'';
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = with pkgs; [
chafa
glib
wayland
mpv
];
meta = {
description = "A keyboard-driven WhatsApp client for the terminal";
homepage = "https://github.com/Andiveli/wptui";
license = lib.licenses.mit;
mainProgram = "wp-tui";
platforms = lib.platforms.linux;
};
});
whatsrust = default;
}
);
};
}