nyazoom/flake.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

2024-08-28 15:05:40 -07:00
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
2024-12-26 23:33:24 -08:00
flake-parts.url = "github:hercules-ci/flake-parts";
2024-08-28 15:05:40 -07:00
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2024-12-26 22:39:00 -08:00
outputs = inputs@{ nixpkgs, rust-overlay, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
2024-08-28 15:05:40 -07:00
"x86_64-linux"
2024-11-15 10:12:44 -08:00
"aarch64-darwin"
2024-08-28 15:05:40 -07:00
];
2024-12-26 22:39:00 -08:00
perSystem = { system, pkgs, ... }: {
_module.args.pkgs = (import nixpkgs {
2024-08-28 15:05:40 -07:00
inherit system;
overlays = [ rust-overlay.overlays.default ];
});
2024-12-26 22:39:00 -08:00
devShells.default = import ./shell.nix {
inherit pkgs;
additionalBuildInputs = [
(pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [ "rust-src" "rust-analyzer" ];
}))
];
};
2024-12-26 23:33:24 -08:00
packages.default =
let rust-bin = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal);
in pkgs.callPackage ./package.nix {
rustPlatform = pkgs.makeRustPlatform {
rustc = rust-bin;
cargo = rust-bin;
};
2024-12-26 23:33:24 -08:00
};
2024-12-26 22:39:00 -08:00
};
2024-08-28 15:05:40 -07:00
};
}