-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
36 lines (34 loc) · 1.17 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
{
description = "dolphinbot, Dolphin's Discord bot";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.cargo2nix.url = "github:cargo2nix/cargo2nix/main";
inputs.cargo2nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
inputs.rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, flake-utils, cargo2nix, rust-overlay }: {
overlay = nixpkgs.lib.composeManyExtensions [
cargo2nix.overlays.default
rust-overlay.overlays.default
(final: prev: {
discord-bot = let
rustPkgs = prev.rustBuilder.makePackageSet {
rustToolchain = prev.rust-bin.stable.latest.default;
packageFun = import ./Cargo.nix;
};
in
(rustPkgs.workspace.dolphinbot {}).bin;
})
];
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in with pkgs; {
packages = { inherit discord-bot; };
defaultPackage = self.packages.${system}.discord-bot;
}
));
}