From 6355f81f02d0baa2628a7d670868b12bf30e7806 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Wed, 4 Oct 2023 14:45:53 +0000 Subject: [PATCH] flake.nix: wrap stack using pkgs-recent --- flake.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 663a99ec2..2ecc482e0 100644 --- a/flake.nix +++ b/flake.nix @@ -112,8 +112,26 @@ overlays = [ (final: prev: let - pkgs-recent = import nixpkgs-recent { inherit system; }; - in { inherit (pkgs-recent) dockerTools node2nix stack glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs-recent.stdenv) fetchurlBoot; }) + pkgs-recent = import nixpkgs-recent { inherit system; }; + in { + inherit (pkgs-recent) dockerTools node2nix glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs-recent.stdenv) fetchurlBoot; + stack = pkgs.symlinkJoin { + inherit (pkgs-recent.stack) name; + paths = [pkgs-recent.stack]; + nativeBuildInputs = [pkgs-recent.makeWrapper]; + + postBuild = '' + wrapProgram $out/bin/stack \ + --prefix PATH : "${prev.lib.makeBinPath [pkgs-recent.nix]}" \ + --add-flags "\ + --nix \ + --no-nix-pure \ + --nix-shell-file=${./stack.nix} \ + --nix-path=nixpkgs=${nixpkgs} \ + " + ''; + }; + }) (import ./nix/maildev) haskell-nix.overlay