youmubot/flake.nix
Unknown e07949378c
Some checks are pending
Build and Test / Format check (push) Waiting to run
Build and Test / Lint (push) Waiting to run
Build and Test / Test (push) Waiting to run
Build and Test / Check dependency hash (push) Waiting to run
Build and Test / Build (push) Waiting to run
Migrate from crane back to buildRustPackage
2025-03-31 16:13:51 +02:00

57 lines
1.7 KiB
Nix

{
description = "A discord bot for D Tuyn Tng Hp server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
extra-substituters = [ "https://natsukagami.cachix.org" ];
extra-trusted-public-keys = [ "natsukagami.cachix.org-1:3U6GV8i8gWEaXRUuXd2S4ASfYgdl2QFPWg4BKPbmYiQ=" ];
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs
{
inherit system; overlays = [ (import inputs.rust-overlay) ];
};
in
rec {
packages.youmubot = pkgs.callPackage ./package.nix { };
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
{
inputsFrom = [ packages.youmubot ];
buildInputs = with pkgs; [ rustfmt clippy sqlx-cli rust-analyzer ];
nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [
pkg-config
]);
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
};
}) // {
overlays.default = final: prev: {
youmubot = final.callPackage ./package.nix { };
};
# module
nixosModules.default = import ./module.nix;
};
}