-
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathflake.nix
More file actions
74 lines (65 loc) · 2.17 KB
/
flake.nix
File metadata and controls
74 lines (65 loc) · 2.17 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
{
description = "matcha — a beautiful and functional email client for the terminal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
gomod2nixPkgs = gomod2nix.legacyPackages.${system};
in
{
packages = rec {
matcha = gomod2nixPkgs.buildGoApplication {
go = pkgs.go_1_26;
pname = "matcha";
version = self.shortRev or "dev";
src = ./.;
modules = ./gomod2nix.toml;
CGO_ENABLED = 1;
nativeBuildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.pkg-config
];
buildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
pkgs.apple-sdk
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
pkgs.pcsclite
];
ldflags = [
"-s"
"-w"
"-X main.version=${self.shortRev or "dev"}"
"-X main.commit=${self.rev or "dirty"}"
"-X main.date=1970-01-01T00:00:00Z"
];
meta = {
description = "A beautiful and functional email client for the terminal";
homepage = "https://github.com/floatpane/matcha";
license = pkgs.lib.licenses.mit;
mainProgram = "matcha";
};
};
default = matcha;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_26
gopls
gotools
gomod2nix.packages.${system}.default
];
};
}
) // {
overlays.default = final: _prev: {
matcha = self.packages.${final.system}.matcha;
};
};
}