diff --git a/default.nix b/default.nix index d9b1bcbddb8..d54328097b2 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,10 @@ -{ customConfig ? {} -, target ? builtins.currentSystem }: +let + lib = (import ./lib.nix).pkgs.lib; + commitIdFromGitRepo = import ./nix/commit-id.nix { inherit lib; }; +in { customConfig ? {} +, target ? builtins.currentSystem +, gitrev ? commitIdFromGitRepo ./.git +}: # # # Generated targets include anything from stack.yaml (via nix-tools:stack-to-nix and the nix/regenerate.sh script) @@ -23,7 +28,7 @@ let system = if target != "x86_64-windows" then target else builtins.currentSystem; - crossSystem = if target == "x86_64-windows" then commonLib.pkgs.lib.systems.examples.mingwW64 else null; + crossSystem = if target == "x86_64-windows" then lib.systems.examples.mingwW64 else null; # commonLib provides iohk-nix tooling and extra libraries specific to cardano-sl. commonLib = import ./lib.nix; pkgs = import commonLib.nixpkgs { inherit system crossSystem; }; @@ -42,7 +47,8 @@ let }; # daedalus bridge contains the binaries and config files daedalus requires daedalus-bridge = pkgs.callPackage ./nix/daedalus-bridge.nix { - inherit nixTools cardanoConfig; + inherit nixTools cardanoConfig gitrev; + version = nixTools.nix-tools._raw.cardano-sl.identifier.version; }; in { inherit pkgs; diff --git a/nix/daedalus-bridge.nix b/nix/daedalus-bridge.nix index 76ffe58ce0f..f4213a4bbbe 100644 --- a/nix/daedalus-bridge.nix +++ b/nix/daedalus-bridge.nix @@ -1,6 +1,6 @@ { runCommand, stdenv , nixTools, cardanoConfig -, version ? "unstable", gitrev ? "abcdef", buildId ? null }: +, version ? "unstable", gitrev, buildId ? null }: with stdenv.lib; diff --git a/release.nix b/release.nix index 8e2beb97822..d8de5679e94 100644 --- a/release.nix +++ b/release.nix @@ -1,7 +1,16 @@ let commonLib = import ./lib.nix; - default = import ./. {}; disabled = []; +in { cardano ? { outPath = ./.; rev = "abcdef"; }, ... }@args: +let + getArchDefault = system: let + table = { + x86_64-linux = import ./. { target = "x86_64-linux"; gitrev = cardano.rev; }; + x86_64-darwin = import ./. { target = "x86_64-darwin"; gitrev = cardano.rev; }; + x86_64-windows = import ./. { target = "x86_64-windows"; gitrev = cardano.rev; }; + }; + in table.${system}; + default = getArchDefault builtins.currentSystem; makeConnectScripts = cluster: let getScript = name: { x86_64-linux = (getArchDefault "x86_64-linux").connectScripts.${cluster}.${name}; @@ -13,7 +22,7 @@ let wallet = getScript "wallet"; }; wrapDockerImage = cluster: let - images = default.dockerImages; + images = (getArchDefault "x86_64-linux").dockerImages; wrapImage = image: commonLib.pkgs.runCommand "${image.name}-hydra" {} '' mkdir -pv $out/nix-support/ cat < $out/nix-support/hydra-build-products @@ -31,14 +40,7 @@ let dockerImage = wrapDockerImage cluster; }; }; - getArchDefault = system: let - table = { - x86_64-linux = import ./. { target = "x86_64-linux"; }; - x86_64-darwin = import ./. { target = "x86_64-darwin"; }; - x86_64-windows = import ./. { target = "x86_64-windows"; }; - }; - in table.${system}; -in { cardano ? { outPath = ./.; rev = "abcdef"; }, ... }@args: +in commonLib.pkgs.lib.mapAttrsRecursiveCond (as: !(as ? "type" && as.type == "derivation")) (path: v: if (builtins.elem path disabled) then null else v)