diff options
-rw-r--r-- | release.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/release.nix b/release.nix index b81ca837..5ce3201f 100644 --- a/release.nix +++ b/release.nix @@ -1,4 +1,5 @@ { vuizvui ? { outPath = ./.; revCount = 12345; shortRev = "abcdefg"; } +, nixpkgs ? { outPath = <nixpkgs>; revCount = 12345; shortRev = "abcdefg"; } , supportedSystems ? [ "i686-linux" "x86_64-linux" ] }: @@ -7,6 +8,19 @@ let pkgsUpstream = import <nixpkgs> { inherit system; }; root = import ./default.nix { inherit system; }; + patchNixpkgsReference = path: '' + find -iname '*.nix' -type f -exec \ + sed -i -re 's!<nixpkgs([^>]*)>!${path}\1!g' {} + + ''; + + patchedNixpkgs = pkgsUpstream.stdenv.mkDerivation rec { + name = "nixpkgs-${version}"; + version = "${toString nixpkgs.revCount}.${nixpkgs.shortRev}"; + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + installPhase = "cp -r . \"$out\""; + patchPhase = patchNixpkgsReference "'\"$out\"'"; + }; + in with pkgsUpstream.lib; with builtins; { machines = mapAttrsRecursiveCond (m: !(m ? build)) (path: attrs: @@ -29,6 +43,7 @@ in with pkgsUpstream.lib; with builtins; { name = "vuizvui-channel-${attrs.name or "generic"}-${version}"; version = "${toString vuizvui.revCount}.${vuizvui.shortRev}"; src = vuizvui; + patchPhase = patchNixpkgsReference patchedNixpkgs; } // removeAttrs attrs [ "name" ]); in { |