Add flake

This commit is contained in:
Natsu Kagami 2021-11-03 12:58:09 -04:00
parent b9776bddde
commit 6f84441823
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
4 changed files with 112 additions and 0 deletions

35
flake.nix Normal file
View file

@ -0,0 +1,35 @@
{
description = "A discord bot for D Tuyn Tng Hp server";
inputs = {
naersk.url = "github:nix-community/naersk";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, naersk, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
naersk-lib = naersk.lib."${system}";
in
rec {
packages.youmubot = naersk-lib.buildPackage {
name = "youmubot";
version = "0.1.0";
root = ./.;
cargoBuildOptions = opts: opts ++ [ "--package youmubot" ];
};
defaultPackage = packages.youmubot;
# `nix run`
apps.youmubot = flake-utils.lib.mkApp {
drv = packages.youmubot;
exePath = "/bin/youmubot";
};
defaultApp = apps.youmubot;
# `nix develop`
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ rustc cargo ];
};
});
}