From f4d04077c6a35ae31ef482b6339eff4231b0877d Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 24 Mar 2020 16:45:01 -0400 Subject: [PATCH] Split native programs build from the main build for shell use This way, we can fully run the mirror script in dry-run mode. --- flake.nix | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index bfe385b..ec9615e 100644 --- a/flake.nix +++ b/flake.nix @@ -11,25 +11,16 @@ overlay = final: prev: { - nixos-channel-scripts = with final; stdenv.mkDerivation { - name = "nixos-channel-scripts"; - - buildInputs = with final.perlPackages; - [ pkgconfig + nixos-channel-native-programs = with final; stdenv.mkDerivation { + name = "nixos-channel-native-programs"; + buildInputs = [ final.nix - sqlite - makeWrapper - perl - FileSlurp - LWP - LWPProtocolHttps - ListMoreUtils - DBDSQLite - NetAmazonS3 + pkgconfig boehmgc nlohmann_json boost - ]; + sqlite + ]; buildCommand = '' mkdir -p $out/bin @@ -48,9 +39,35 @@ $(pkg-config --libs nix-main) \ $(pkg-config --libs nix-store) \ -lsqlite3 -lnixrust + ''; + }; + + nixos-channel-scripts = with final; stdenv.mkDerivation { + name = "nixos-channel-scripts"; + + buildInputs = with final.perlPackages; + [ final.nix + sqlite + makeWrapper + perl + FileSlurp + LWP + LWPProtocolHttps + ListMoreUtils + DBDSQLite + NetAmazonS3 + brotli + jq + nixos-channel-native-programs + ]; + + buildCommand = '' + mkdir -p $out/bin cp ${./mirror-nixos-branch.pl} $out/bin/mirror-nixos-branch - wrapProgram $out/bin/mirror-nixos-branch --set PERL5LIB $PERL5LIB --prefix PATH : ${wget}/bin:${git}/bin:${final.nix}/bin:${gnutar}/bin:${xz}/bin:${rsync}/bin:${openssh}/bin:$out/bin + wrapProgram $out/bin/mirror-nixos-branch \ + --set PERL5LIB $PERL5LIB \ + --prefix PATH : ${wget}/bin:${git}/bin:${final.nix}/bin:${gnutar}/bin:${xz}/bin:${rsync}/bin:${openssh}/bin:${nixos-channel-native-programs}:$out/bin patchShebangs $out/bin '';