-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
54 lines (46 loc) · 1.62 KB
/
flake.nix
File metadata and controls
54 lines (46 loc) · 1.62 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
{
description = "tobby — keyboard-driven IRC client for the terminal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
pname = "tobby";
version = "0.2.13"; # @nix-version
src = pkgs.fetchurl {
url = "https://registry.npmjs.org/@mattfillipe/tobby/-/tobby-${version}.tgz";
hash = "sha256-jWlihr028LSqlCvjwemSF/YAVbO+xf8AKtTqVU4UsTI="; # @nix-hash
};
in
{
packages.default = pkgs.stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = [ pkgs.makeWrapper ];
# npm tarballs always extract to a `package/` directory
unpackPhase = ''
tar -xzf $src
'';
dontBuild = true;
installPhase = ''
mkdir -p $out/lib/tobby
cp -r package/dist $out/lib/tobby/dist
makeWrapper ${pkgs.bun}/bin/bun $out/bin/tobby \
--add-flags "$out/lib/tobby/dist/index.js"
'';
meta = with pkgs.lib; {
description = "Keyboard-driven IRC client for the terminal";
homepage = "https://github.com/ObsidianIRC/tobby";
license = licenses.gpl3Only;
mainProgram = "tobby";
platforms = platforms.unix;
};
};
apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/tobby";
};
});
}