scaffolding
This commit is contained in:
59
flake.nix
Normal file
59
flake.nix
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
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"];
|
||||
})
|
||||
(rust-toolchain-nightly.override {
|
||||
extensions = ["rustfmt"];
|
||||
})
|
||||
pkgs.taplo
|
||||
pkgs.fd
|
||||
pkgs.cargo-nextest
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user