nyazoom/flake.nix
2024-12-26 23:33:24 -08:00

41 lines
1.2 KiB
Nix

{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ nixpkgs, rust-overlay, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-darwin"
];
perSystem = { system, pkgs, ... }: {
_module.args.pkgs = (import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
});
devShells.default = import ./shell.nix {
inherit pkgs;
additionalBuildInputs = [
(pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
}))
];
};
packages.default =
let rust-bin = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal);
in pkgs.callPackage ./package.nix {
cargo = rust-bin;
rustc = rust-bin;
};
};
};
}