Skip to content

Commit

Permalink
fix: revert to build packages manually in flake check (#418)
Browse files Browse the repository at this point in the history
* fix: revert to build packages manually in flake check so buildbot can build them

* fix: pin down wake platforms

* fix: update flake.lock with fixes to mkdocs plugins platforms

* fix: improve mkdocs.nix
  • Loading branch information
aldoborrero authored Nov 29, 2023
1 parent 45b8a8d commit de7eaae
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 60 deletions.
26 changes: 6 additions & 20 deletions flake.lock

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

37 changes: 20 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
inputs.lib-extras.follows = "lib-extras";
inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.treefmt-nix.follows = "treefmt-nix";
inputs.devour-flake.follows = "devour-flake";
};

foundry-nix = {
Expand Down Expand Up @@ -91,6 +92,7 @@
pkgs,
pkgsUnstable,
system,
self',
...
}: {
# pkgs
Expand Down Expand Up @@ -169,25 +171,26 @@
};

# checks
checks = let
devour-flake = pkgs.callPackage inputs.devour-flake {};
in
checks =
{
nix-build-all = pkgs.writeShellApplication {
name = "nix-build-all";
runtimeInputs = [
pkgs.nix
devour-flake
];
text = ''
# Make sure that flake.lock is sync
nix flake lock --no-update-lock-file
# Do a full nix build (all outputs)
devour-flake . "$@"
'';
};
# TODO: Restore this check whenever buildbot supports more specific checks
# nix-build-all = pkgs.writeShellApplication {
# name = "nix-build-all";
# runtimeInputs = [
# pkgs.nix
# devour-flake
# ];
# text = ''
# # Make sure that flake.lock is sync
# nix flake lock --no-update-lock-file
#
# # Do a full nix build (all outputs)
# devour-flake . "$@"
# '';
# };
}
# merge in the package derivations to force a build of all packages during a `nix flake check`
// (with lib; mapAttrs' (n: nameValuePair "package-${n}") (filterAttrs (n: _: ! builtins.elem n ["docs"]) self'.packages))
# mix in tests
// config.testing.checks;
};
Expand Down
44 changes: 21 additions & 23 deletions mkdocs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,29 @@
...
}: let
inherit (pkgs) stdenv runCommand;

mkdocs-custom =
runCommand "mkdocs-custom" {
buildInputs = [
pkgs.python311
pkgs.python311Packages.mkdocs
pkgs.python311Packages.mkdocs-material
inputs.mynixpkgs.packages.${system}.mkdocs-plugins
];

meta.mainProgram = "mkdocs";
} ''
mkdir -p $out/bin
cat <<MKDOCS > $out/bin/mkdocs
#!${pkgs.runtimeShell}
set -euo pipefail
export PYTHONPATH=$PYTHONPATH
exec ${pkgs.python311Packages.mkdocs}/bin/mkdocs "\$@"
MKDOCS
chmod +x $out/bin/mkdocs
'';
in {
packages.docs = let
mkdocs-custom =
pkgs.runCommand "mkdocs-custom" {
buildInputs = [
pkgs.python311
pkgs.python311Packages.mkdocs
pkgs.python311Packages.mkdocs-material
inputs.mynixpkgs.packages.${system}.mkdocs-plugins
];
meta.mainProgram = "mkdocs";
} ''
mkdir -p $out/bin
cat <<MKDOCS > $out/bin/mkdocs
#!${pkgs.runtimeShell}
set -euo pipefail
export PYTHONPATH=$PYTHONPATH
exec ${pkgs.python311Packages.mkdocs}/bin/mkdocs "\$@"
MKDOCS
chmod +x $out/bin/mkdocs
'';
docsPath = "./docs/nixos/modules";
nixosMarkdownDocs = runCommand "nixos-options" {} ''
mkdir $out
Expand Down
25 changes: 25 additions & 0 deletions packages/clients/consensus/lodestar/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
stdenv,
fetchFromGitHub,
fetchYarnDeps,
nodePackages,
}: let
name = "lodestar";
version = "1.12.0";

src = fetchFromGitHub {
owner = "ChainSafe";
repo = "lodestar";
ref = "refs/tags/v${version}";
hash = "";
};

yarnDeps = stdenv.mkDerivation {
yarnLock = "${src}/yarn.lock";
hash = "";

};
in yarnDeps
# in stdenv.mkDerivation {
# inherit name version src;
# }
1 change: 1 addition & 0 deletions packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
prysm = callPackage ./clients/consensus/prysm {inherit bls blst;};
teku = callPackage ./clients/consensus/teku {};
nimbus = callPackageUnstable ./clients/consensus/nimbus {};
lodestar = callPackage ./clients/consensus/lodestar {};

# Execution Clients
erigon = callPackage ./clients/execution/erigon {};
Expand Down
4 changes: 4 additions & 0 deletions packages/solidity/frameworks/wake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ poetry2nix.mkPoetryApplication {
changelog = "https://github.com/Ackee-Blockchain/wake/releases/tag/v${version}";
mainProgram = "woke";
license = licenses.mit;
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with maintainers; [aldoborrero];
};
}

0 comments on commit de7eaae

Please sign in to comment.