53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{
|
|
description = "A basic flake with a shell";
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
inputs.fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.rust-analyzer-src.follows = "";
|
|
};
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
inputs.crane.url = "github:ipetkov/crane";
|
|
inputs.cargo-aoc.url = "github:traxys/aoc-tool";
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
crane,
|
|
fenix,
|
|
cargo-aoc,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ fenix.overlays.default ];
|
|
};
|
|
rust = pkgs.fenix.stable.defaultToolchain;
|
|
craneLib = crane.mkLib pkgs;
|
|
in
|
|
{
|
|
devShell = pkgs.mkShell {
|
|
nativeBuildInputs = [
|
|
rust
|
|
cargo-aoc.defaultPackage.${system}
|
|
]
|
|
++ (with pkgs; [
|
|
hyperfine
|
|
cargo-flamegraph
|
|
cargo-show-asm
|
|
]);
|
|
RUST_PATH = "${rust}";
|
|
RUST_DOC_PATH = "${rust}/share/doc/rust/html/std/index.html";
|
|
AOC_YEAR = "2025";
|
|
};
|
|
|
|
defaultPackage = craneLib.buildPackage {
|
|
src = craneLib.cleanCargoSource ./.;
|
|
};
|
|
}
|
|
);
|
|
}
|