From 2cd6e979705f929d53190f9dcaead239be5323d8 Mon Sep 17 00:00:00 2001 From: Jacob Birkett Date: Mon, 26 Aug 2024 20:23:57 -0700 Subject: [PATCH] nix: package+devShell: set strictDeps = true --- flake.nix | 1 + nix/overlay.nix | 14 ++++++++++++++ nix/package.nix | 1 + 3 files changed, 16 insertions(+) create mode 100644 nix/overlay.nix diff --git a/flake.nix b/flake.nix index 5725553..32cadb0 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,7 @@ in { devShells = lib.mapAttrs (system: pkgs: { default = pkgs.mkShell { + strictDeps = true; buildInputs = [ pkgs.rust-bin.stable.${rustVersion}.default ]; }; }) pkgsFor; diff --git a/nix/overlay.nix b/nix/overlay.nix new file mode 100644 index 0000000..ff34131 --- /dev/null +++ b/nix/overlay.nix @@ -0,0 +1,14 @@ +final: _: +let + rust-bin = rust-overlay.lib.mkRustBin { } final; + rust-stable = rust-bin.stable.${rustVersion}.minimal; + rustPlatform = final.makeRustPlatform { + cargo = rust-stable; + rustc = rust-stable; + }; +in { + ${packageName} = final.callPackage ./nix/package.nix { + sourceRoot = self; + inherit rustPlatform; + }; +} diff --git a/nix/package.nix b/nix/package.nix index 1d004ad..ae573bc 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -5,4 +5,5 @@ in rustPlatform.buildRustPackage { version = manifest.package.version; cargoLock.lockFile = "${sourceRoot}/Cargo.lock"; src = lib.cleanSource sourceRoot; + strictDeps = true; }