mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
improve nix devshell
This commit is contained in:
parent
b6eec3784d
commit
26f855b7b9
3 changed files with 318 additions and 0 deletions
46
flake.nix
Normal file
46
flake.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
inputs.nci.url = "github:yusdacra/nix-cargo-integration";
|
||||
inputs.nci.inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.parts.url = "github:hercules-ci/flake-parts";
|
||||
inputs.parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
|
||||
outputs = inputs @ {
|
||||
parts,
|
||||
nci,
|
||||
...
|
||||
}:
|
||||
parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
imports = [nci.flakeModule];
|
||||
perSystem = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
rustOutputs = config.nci.outputs;
|
||||
rustDeps = with pkgs; [rust-analyzer];
|
||||
webDeps = with pkgs; [yarn nodejs];
|
||||
csDeps = with pkgs; [gcc protobuf dotnet-sdk_6 go];
|
||||
in {
|
||||
nci.toolchainConfig = ./rust-toolchain.toml;
|
||||
nci.projects."pluralkit" = {
|
||||
path = ./.;
|
||||
export = true;
|
||||
};
|
||||
# configure crates
|
||||
nci.crates = {
|
||||
# see for usage: https://github.com/yusdacra/nix-cargo-integration/blob/master/examples/simple-workspace/crates.nix
|
||||
};
|
||||
|
||||
devShells.default = rustOutputs."pluralkit".devShell.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ webDeps ++ csDeps ++ rustDeps;
|
||||
});
|
||||
devShells.web = pkgs.mkShell {nativeBuildInputs = webDeps;};
|
||||
devShells.rust = rustOutputs."pluralkit".devShell.overrideAttrs (old: { nativeBuildInputs = old.nativeBuildInputs ++ rustDeps; });
|
||||
devShells.cs= pkgs.mkShell {
|
||||
nativeBuildInputs = csDeps;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue