Skip to content

Commit 4c1d538

Browse files
committed
add flake for building
1 parent d6c2561 commit 4c1d538

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "A simple discord bot made for my [discord](https://discord.gg/mY8
44
edition = "2021"
55
license = "Apache-2"
66
name = "tricked-bot"
7-
version = "1.3.0"
7+
version = "1.4.0"
88
default-run = "tricked-bot"
99

1010
[profile.release]
@@ -23,7 +23,7 @@ tokio = { version = "1", features = [
2323
"rt",
2424
"rt-multi-thread",
2525
'macros',
26-
"parking_lot"
26+
"parking_lot",
2727
] }
2828
toml = "^0.8"
2929
tracing = "0.1"
@@ -47,4 +47,4 @@ r2d2_sqlite = "0.30.0"
4747
r2d2 = "0.8.10"
4848
wb_sqlite = "0.2.1"
4949
rusqlite = { version = "0.36.0", features = ["bundled"] }
50-
num-format = "0.4.4"
50+
num-format = "0.4.4"

flake.nix

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description = "A devShell example";
2+
description = "A Discord bot made for my discord server";
33

44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -22,8 +22,44 @@
2222
pkgs = import nixpkgs {
2323
inherit system overlays;
2424
};
25+
rustToolchain = pkgs.rust-bin.beta.latest.default;
2526
in
2627
{
28+
packages = {
29+
default = self.packages.${system}.tricked-bot;
30+
31+
tricked-bot = pkgs.rustPlatform.buildRustPackage {
32+
pname = "tricked-bot";
33+
version = "1.4.0";
34+
35+
src = ./.;
36+
37+
cargoLock = {
38+
lockFile = ./Cargo.lock;
39+
};
40+
41+
nativeBuildInputs = with pkgs; [
42+
pkg-config
43+
rustToolchain
44+
];
45+
46+
buildInputs = with pkgs; [
47+
openssl
48+
];
49+
50+
meta = with pkgs.lib; {
51+
description = "A simple discord bot made for my discord";
52+
homepage = "https://discord.gg/mY8zTARu4g";
53+
license = licenses.asl20;
54+
maintainers = [ ];
55+
};
56+
};
57+
};
58+
59+
overlays.default = final: prev: {
60+
tricked-bot = self.packages.${system}.tricked-bot;
61+
};
62+
2763
devShells.default =
2864
with pkgs;
2965
mkShell {
@@ -34,7 +70,7 @@
3470
fd
3571
clang
3672
mold
37-
rust-bin.beta.latest.default
73+
rustToolchain
3874
];
3975

4076
LD_LIBRARY_PATH = lib.makeLibraryPath [

0 commit comments

Comments
 (0)