64 lines
1.8 KiB
Nix
64 lines
1.8 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs @ {flake-parts, ...}: let
|
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
|
in
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
systems = ["x86_64-linux"];
|
|
perSystem = {
|
|
pkgs,
|
|
system,
|
|
self',
|
|
...
|
|
}: let
|
|
rust-toolchain = pkgs.rust-bin.stable.latest.minimal;
|
|
rust-toolchain-nightly = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal);
|
|
rustPlatform = pkgs.makeRustPlatform {
|
|
cargo = rust-toolchain;
|
|
rustc = rust-toolchain;
|
|
};
|
|
in {
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
(import inputs.rust-overlay)
|
|
];
|
|
};
|
|
|
|
# packages.default = rustPlatform.buildRustPackage {
|
|
# pname = cargoToml.package.name;
|
|
# version = cargoToml.package.version;
|
|
# src = ./.;
|
|
# cargoLock.lockFile = ./Cargo.lock;
|
|
# nativeBuildInputs = [
|
|
# pkgs.pkg-config
|
|
# ];
|
|
# };
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = [
|
|
(rust-toolchain.override {
|
|
extensions = ["rust-std" "rust-src" "clippy" "rust-analyzer"];
|
|
targets = ["wasm32-unknown-unknown"];
|
|
})
|
|
(rust-toolchain-nightly.override {
|
|
extensions = ["rustfmt"];
|
|
})
|
|
pkgs.taplo
|
|
pkgs.fd
|
|
pkgs.cargo-nextest
|
|
pkgs.xh
|
|
pkgs.websocat
|
|
pkgs.trunk
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|