-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
62 lines (59 loc) · 2.05 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
{
description = "Flake for kanata-tray";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
runtime-deps = [ pkgs.libayatana-appindicator pkgs.gtk3 ];
build-deps = [ pkgs.pkg-config ];
in
rec {
packages.default = packages.kanata-tray;
packages.kanata-tray =
pkgs.buildGoModule {
name = "kanata-tray";
src = pkgs.lib.cleanSource ./.;
vendorHash = "sha256-2rR368zzVFhgntVDynXCYNWzM4jalsnDRGaUo81bqIE=";
env.CGO_ENABLED = 1;
flags = [ "-trimpath" ];
ldflags = [
"-s"
"-w"
"-X main.buildVersion=nix"
"-X main.buildHash=${self.shortRev or self.dirtyShortRev or "unknown"}"
"-X main.buildDate=unknown"
];
nativeBuildInputs = build-deps;
buildInputs = runtime-deps ++ [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/kanata-tray --set KANATA_TRAY_LOG_DIR /tmp --prefix PATH : $out/bin
'';
meta = with pkgs.lib; {
description = "Tray Icon for Kanata";
longDescription = ''
A simple wrapper for kanata to control it from tray icon.
Works on Windows, Linux and macOS.
'';
homepage = "https://github.com/rszyma/kanata-tray";
license = licenses.gpl3;
platforms = platforms.unix;
};
};
devShells.default = pkgs.mkShell
{
packages = with pkgs;
build-deps
++ runtime-deps
++ [
# converting png -> ico
# convert input.png -define icon:auto-resize=48,32,16 output.ico
imagemagick
];
};
}
);
}