mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-23 08:40:49 +00:00
Add helpful packages to flake
This commit is contained in:
parent
4b1ae32256
commit
8bb8b4114a
1 changed files with 52 additions and 31 deletions
83
flake.nix
83
flake.nix
|
@ -10,43 +10,65 @@
|
|||
};
|
||||
nixConfig = {
|
||||
extra-substituters = [ "https://natsukagami.cachix.org" ];
|
||||
extra-trusted-public-keys = [ "natsukagami.cachix.org-1:3U6GV8i8gWEaXRUuXd2S4ASfYgdl2QFPWg4BKPbmYiQ=" ];
|
||||
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 { };
|
||||
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;
|
||||
defaultPackage = packages.youmubot;
|
||||
|
||||
# `nix run`
|
||||
apps.youmubot = flake-utils.lib.mkApp {
|
||||
drv = packages.youmubot;
|
||||
exePath = "/bin/youmubot";
|
||||
};
|
||||
defaultApp = apps.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 ];
|
||||
# `nix develop`
|
||||
devShell = pkgs.mkShell {
|
||||
inputsFrom = [ packages.youmubot ];
|
||||
|
||||
buildInputs = with pkgs; [ rustfmt clippy sqlx-cli rust-analyzer ];
|
||||
buildInputs = with pkgs; [
|
||||
rustfmt
|
||||
clippy
|
||||
sqlx-cli
|
||||
rust-analyzer
|
||||
|
||||
nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [
|
||||
pkg-config
|
||||
]);
|
||||
curl
|
||||
jq
|
||||
|
||||
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
|
||||
};
|
||||
}) // {
|
||||
sqlite-interactive
|
||||
];
|
||||
|
||||
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 { };
|
||||
};
|
||||
|
@ -54,4 +76,3 @@
|
|||
nixosModules.default = import ./module.nix;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue