Initial commit
This commit is contained in:
commit
0e6e7d7a10
4 changed files with 327 additions and 0 deletions
53
flake.nix
Normal file
53
flake.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
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 = "2024";
|
||||
};
|
||||
|
||||
defaultPackage = craneLib.buildPackage {
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue