From 3fd2674cb905bf9a5abebae6f374fd92fffebd04 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 3 Dec 2024 11:33:56 +0100 Subject: [PATCH] fix(flake): build the root package, not "foobar" --- flake.nix | 19 ++++++++----------- src/main.rs | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/flake.nix b/flake.nix index 0211d13..611363a 100644 --- a/flake.nix +++ b/flake.nix @@ -65,19 +65,16 @@ overlays = [ (import inputs.rust-overlay) ]; }; - packages.default = self'.packages.example; + packages.default = (rustPackage ""); devShells.default = pkgs.mkShell { - shellHook = '' - export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} - ''; - buildInputs = runtimeDeps; - nativeBuildInputs = buildDeps ++ devDeps ++ [ (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) ]; - }; + shellHook = '' + export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc} + ''; + buildInputs = runtimeDeps; + nativeBuildInputs = + buildDeps ++ devDeps ++ [ (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)) ]; + }; - packages.example = (rustPackage "foobar"); - packages.example-base = (rustPackage ""); - - treefmt = { projectRootFile = "./flake.nix"; programs = { diff --git a/src/main.rs b/src/main.rs index d00b4de..c722a87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ fn main() { tracing_subscriber::fmt::init(); solve_day(1, day01::pt1, day01::pt2); solve_day(2, day02::pt1, day02::pt2); - solve_day(3, day03::pt1, day03::pt2); + solve_day(3, day03::pt1, day03::pt2); } fn solve_day(day: u8, part_a: Fa, part_b: Fb)