From d7b77fe5b508041bda11c129264da054c341675e Mon Sep 17 00:00:00 2001 From: electria Date: Sun, 9 Aug 2026 10:52:42 -0700 Subject: [PATCH] refactor: use a more generic flake style --- flake.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 190d497..62c5763 100644 --- a/flake.nix +++ b/flake.nix @@ -15,20 +15,22 @@ cargoToml = fromTOML (builtins.readFile ./Cargo.toml); name = cargoToml.package.name; - nativeBuildInputs = with pkgs; [ - m4 - ]; - in - { - packages.default = pkgs.rustPlatform.buildRustPackage { - inherit name nativeBuildInputs; + crate = pkgs.rustPlatform.buildRustPackage { + inherit name; src = ./.; cargoLock.lockFile = ./Cargo.lock; + + nativeBuildInputs = with pkgs; [ + m4 + ]; }; + in + { + packages.default = crate; devShells.default = pkgs.mkShell { - inherit nativeBuildInputs; + inputsFrom = [ crate ]; packages = with pkgs; [ rustc