Skip to content

Commit 03df39d

Browse files
committed
nix: make the repository a flake
Now you can build the bot using `nix build .#telegram` The discord bot is still a TODO
1 parent ec38eb9 commit 03df39d

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

flake.lock

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
description = "";
3+
4+
inputs = {
5+
utils.url = "github:numtide/flake-utils";
6+
};
7+
8+
outputs = { self, nixpkgs, utils }:
9+
utils.lib.eachDefaultSystem (system: let
10+
pkgs = nixpkgs.legacyPackages."${system}";
11+
lib = pkgs.lib;
12+
in rec {
13+
# `nix build`
14+
packages.telegram = pkgs.buildGoModule rec {
15+
name = "telegram-bot";
16+
src = ./telegram-bot;
17+
18+
vendorSha256 = "sha256-NBY2T0Jj5f9XMoc0hleituKHFf+9AFq056a/EpCsuXo=";
19+
};
20+
defaultPackage = packages.telegram;
21+
22+
# `nix run`
23+
apps.telegram = utils.lib.mkApp {
24+
drv = packages.telegram;
25+
};
26+
defaultApp = apps.telegram;
27+
28+
# `nix develop`
29+
devShell = pkgs.mkShell {
30+
nativeBuildInputs = with pkgs; [ go ];
31+
};
32+
});
33+
}

0 commit comments

Comments
 (0)