nichts/templates/rust/flake.nix

37 lines
865 B
Nix
Raw Normal View History

2025-06-05 08:27:20 +02:00
{
description = "Rust project template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";
};
outputs =
inputs:
let
inherit (inputs.nixpkgs) lib;
inherit (lib.attrsets) genAttrs mapAttrs;
2025-06-05 08:27:20 +02:00
eachSystem = genAttrs (import inputs.systems);
pkgsFor = inputs.nixpkgs.legacyPackages;
in
{
packages = eachSystem (system: {
default = inputs.self.packages.${system}.ralc;
ralc = pkgsFor.${system}.callPackage ./nix/package.nix { };
});
2025-06-05 08:27:20 +02:00
devShells = mapAttrs (_: pkgs: {
2025-06-05 08:27:20 +02:00
default = pkgs.mkShell {
packages = with pkgs; [
cargo
rustc
rustfmt
bacon
rust-analyzer
rustPackages.clippy
];
};
}) pkgsFor;
};
2025-06-05 08:27:20 +02:00
}