mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-23 16:50: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 = {
|
nixConfig = {
|
||||||
extra-substituters = [ "https://natsukagami.cachix.org" ];
|
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:
|
outputs =
|
||||||
flake-utils.lib.eachDefaultSystem
|
{
|
||||||
(system:
|
self,
|
||||||
let
|
nixpkgs,
|
||||||
pkgs = import nixpkgs
|
flake-utils,
|
||||||
{
|
...
|
||||||
inherit system; overlays = [ (import inputs.rust-overlay) ];
|
}@inputs:
|
||||||
};
|
flake-utils.lib.eachDefaultSystem (
|
||||||
in
|
system:
|
||||||
rec {
|
let
|
||||||
packages.youmubot = pkgs.callPackage ./package.nix { };
|
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`
|
# `nix run`
|
||||||
apps.youmubot = flake-utils.lib.mkApp {
|
apps.youmubot = flake-utils.lib.mkApp {
|
||||||
drv = packages.youmubot;
|
drv = packages.youmubot;
|
||||||
exePath = "/bin/youmubot";
|
exePath = "/bin/youmubot";
|
||||||
};
|
};
|
||||||
defaultApp = apps.youmubot;
|
defaultApp = apps.youmubot;
|
||||||
|
|
||||||
# `nix develop`
|
# `nix develop`
|
||||||
devShell = pkgs.mkShell
|
devShell = pkgs.mkShell {
|
||||||
{
|
inputsFrom = [ packages.youmubot ];
|
||||||
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; [
|
curl
|
||||||
pkg-config
|
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: {
|
overlays.default = final: prev: {
|
||||||
youmubot = final.callPackage ./package.nix { };
|
youmubot = final.callPackage ./package.nix { };
|
||||||
};
|
};
|
||||||
|
@ -54,4 +76,3 @@
|
||||||
nixosModules.default = import ./module.nix;
|
nixosModules.default = import ./module.nix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue