Skip to content

Commit

Permalink
Adapt nix build after merge into mono repo
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgi committed May 20, 2022
1 parent abf913d commit 7719444
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 655 deletions.
36 changes: 0 additions & 36 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions flake.nix
Expand Up @@ -35,15 +35,6 @@
capsules.url = "github:input-output-hk/devshell-capsules";
# --------------------------------------------------------------
# --- Bride Heads ----------------------------------------------
# TODO: remove mono-repo and cardano-node (and use self) when mono-repo branch is merged:
cardano-node = {
url = "github:input-output-hk/cardano-node/jordan/dep-bump-protocol-in-block";
flake = false;
};
mono-repo = {
url = "github:input-output-hk/cardano-world/mono-repo";
flake = false;
};
cardano-db-sync.url = "github:input-output-hk/cardano-db-sync/12.0.1-flake-improvements";
cardano-wallet.url = "github:input-output-hk/cardano-wallet";
cardano-ogmios.url = "github:input-output-hk/cardano-ogmios";
Expand Down
6 changes: 0 additions & 6 deletions nix/automation/devshells.nix
Expand Up @@ -72,12 +72,6 @@ in {
inputs.cells.cardano.devshellProfiles.world
];
};
monorepo = std.lib.mkShell {
imports = [
cardanoWorld
inputs.cells.cardano.devshellProfiles.monorepo
];
};
mininal = std.lib.mkShell {
imports = [
cardanoWorld
Expand Down
42 changes: 1 addition & 41 deletions nix/automation/jobs.nix
Expand Up @@ -2,7 +2,7 @@
inputs,
cell,
}: let
inherit (inputs) nixpkgs iohkNix cardano-node;
inherit (inputs) nixpkgs iohkNix;
inherit (nixpkgs) lib;
inherit (inputs.cells.cardano) packages library nixosProfiles;
inherit (inputs.bitte-cells._writers.library) writeShellApplication;
Expand Down Expand Up @@ -67,46 +67,6 @@
fi
'';
in {
update-mono-repo = writeShellApplication {
name = "update-mono-repo";
description = "Update the checksums neccesary to build the mono-repo";
text = let project = packages.project.appendModule { src = lib.mkForce cardano-node; }; in ''
# go to project root directory:
while [[ $PWD != / && ! -e "flake.nix" ]]; do
cd ..
done
nix-prefetch-git --deepClone --leave-dotGit --quiet https://github.com/input-output-hk/cardano-node ${cardano-node.rev} | jq -r .sha256 > nix/cardano/prepare-mono-repo/cardano-node.sha256
nix-prefetch-git --deepClone --leave-dotGit --quiet https://github.com/input-output-hk/ouroboros-network ${project.pkg-set.config.packages.ouroboros-network.src.rev} | jq -r .sha256 > nix/cardano/prepare-mono-repo/ouroboros-network.sha256
nix-prefetch-git --deepClone --leave-dotGit --quiet https://github.com/input-output-hk/cardano-ledger ${project.pkg-set.config.packages.cardano-ledger-core.src.rev} | jq -r .sha256 > nix/cardano/prepare-mono-repo/cardano-ledger.sha256
nix-prefetch-git --deepClone --leave-dotGit --quiet https://github.com/input-output-hk/ekg-forward ${project.pkg-set.config.packages.ekg-forward.src.rev} | jq -r .sha256 > nix/cardano/prepare-mono-repo/ekg-forward.sha256
nix build .#${nixpkgs.system}.cardano.prepare-mono-repo.mono-repo
'';
runtimeInputs = with nixpkgs; [ nix-prefetch-git git jq];
};
merge-mono-repo = writeShellApplication {
description = "Create/Replace the mono-repo branch of current git repo";
name = "merge-mono-repo";
text = ''
# go to project root directory:
while [[ $PWD != / && ! -e ".git" ]]; do
cd ..
done
nix build .#${nixpkgs.system}.cardano.prepare-mono-repo.mono-repo
git branch -D mono-repo || true
git checkout -b mono-repo
git remote add nix-mono-repo ./result || true
git fetch nix-mono-repo
git merge nix-mono-repo/fetchgit --allow-unrelated-histories --no-ff \
-m "Merge cardano-node, ouroborous, ledger and ekg-forward into mono-repo"
git apply -3 nix/cardano/prepare-mono-repo/remove-prepare-mono-repo.diff
rm -r nix/cardano/prepare-mono-repo
nix flake lock --update-input mono-repo
nix flake lock --update-input cardano-node
git commit -a -m "Adapt nix build after merge into mono repo"
'';
runtimeInputs = with nixpkgs; [ nix git ];
};
update-cabal-source-repo-checksums = writeShellApplication {
name = "update-cabal-source-repo-checksums";
text = ''
Expand Down
12 changes: 0 additions & 12 deletions nix/cardano/devshellProfiles.nix
Expand Up @@ -113,16 +113,4 @@ rec {
}
];
};
monorepo = _: {
commands = [
{
package = inputs.cells.automation.jobs.update-mono-repo;
category = "nix-build";
}
{
package = inputs.cells.automation.jobs.merge-mono-repo;
category = "nix-build";
}
];
};
}
5 changes: 2 additions & 3 deletions nix/cardano/packages/default.nix
Expand Up @@ -3,7 +3,7 @@
,
}:
let
inherit (inputs) std nixpkgs iohkNix cardano-node mono-repo
inherit (inputs) std nixpkgs iohkNix self
cardano-wallet cardano-db-sync cardano-ogmios;
inherit (inputs.cells) cardano;
inherit (nixpkgs) lib;
Expand All @@ -29,8 +29,7 @@ let
(import ./haskell.nix {
inherit haskell-nix;
inherit (inputs) byron-chain;
# TODO: swicth to self after mono-repo branch is merged:
src = cardano-node;
src = self;
}).appendOverlays [
devshell
projectComponents
Expand Down
72 changes: 0 additions & 72 deletions nix/cardano/prepare-mono-repo/cabal.diff

This file was deleted.

0 comments on commit 7719444

Please sign in to comment.