Skip to content

Commit

Permalink
Use new Holonix at 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Jul 12, 2024
1 parent 8388673 commit 1253017
Show file tree
Hide file tree
Showing 10 changed files with 544 additions and 787 deletions.
516 changes: 144 additions & 372 deletions flake.lock

Large diffs are not rendered by default.

120 changes: 58 additions & 62 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,95 @@
description = "Flake for Holochain testing";

inputs = {
versions.url = "github:holochain/holochain?dir=versions/0_3";
holonix.url = "github:holochain/holonix/main";

holochain = {
url = "github:holochain/holochain";
inputs.versions.follows = "versions";
};
nixpkgs.follows = "holonix/nixpkgs";
flake-parts.follows = "holonix/flake-parts";

tryorama.url = "github:holochain/tryorama/v0.16.0";
tryorama = {
url = "github:holochain/tryorama/v0.17.0-dev.1";
inputs = {
nixpkgs.follows = "holonix/nixpkgs";

crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "holochain/nixpkgs";
};
};

flake-utils.url = "github:numtide/flake-utils";

rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "holochain/nixpkgs";
nixpkgs.follows = "holonix/nixpkgs";
};
};

amber = {
url = "github:Ph0enixKM/Amber";
inputs.nixpkgs.follows = "holochain/nixpkgs";
inputs.nixpkgs.follows = "holonix/nixpkgs";
};

nixpkgs.follows = "holochain/nixpkgs";
};

outputs = inputs:
inputs.holochain.inputs.flake-parts.lib.mkFlake { inherit inputs; }
outputs = inputs@{ flake-parts, holonix, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ flake-parts-lib, ... }: {
systems = builtins.attrNames inputs.holonix.devShells;
perSystem = { inputs', pkgs, system, config, ... }:
let
rustMod = flake-parts-lib.importApply ./nix/modules/rust.nix { inherit (holonix.inputs) crane; inherit (inputs) nixpkgs rust-overlay; };
in
{
systems = builtins.attrNames inputs.holochain.devShells;
imports = [
./nix/modules/formatter.nix
./nix/modules/happs.nix
./nix/modules/rust.nix
rustMod
./nix/modules/scenario.nix
./nix/modules/scenarios.nix
./nix/modules/workspace.nix
./nix/modules/zome.nix
./nix/modules/zomes.nix
];
perSystem = { lib, config, pkgs, system, self', ... }:
{
devShells.default = pkgs.mkShell {
inputsFrom = [
inputs.holochain.devShells.${system}.holonix
];

packages = [
pkgs.influxdb2-cli
pkgs.influxdb2-server
# TODO https://docs.influxdata.com/telegraf/v1/install/#ntp
pkgs.telegraf
pkgs.yq
pkgs.httpie
pkgs.shellcheck
pkgs.statix
inputs.tryorama.packages.${system}.trycp-server
# inputs.amber.packages.${system}.default
];
devShells.default = pkgs.mkShell {
inputsFrom = [ inputs'.holonix.devShells ];

packages = (with inputs'.holonix.packages; [
holochain
rust # For Rust development, with the WASM target included for zome builds
]) ++ (with pkgs; [
pkgs.influxdb2-cli
pkgs.influxdb2-server
# TODO https://docs.influxdata.com/telegraf/v1/install/#ntp
pkgs.telegraf
pkgs.yq
pkgs.httpie
pkgs.shellcheck
pkgs.statix
inputs.tryorama.packages.${system}.trycp-server
# inputs.amber.packages.${system}.default
]);

shellHook = ''
source ./scripts/influx.sh
source ./scripts/telegraf.sh
source ./scripts/trycp.sh
source ./scripts/checks.sh
'';
};
shellHook = ''
source ./scripts/influx.sh
source ./scripts/telegraf.sh
source ./scripts/trycp.sh
source ./scripts/checks.sh
'';
};

devShells.ci = pkgs.mkShell {
inputsFrom = [
inputs.holochain.devShells.${system}.holochainBinaries
];
devShells.ci = pkgs.mkShell {
inputsFrom = [ inputs'.holonix.devShells ];

packages = [
pkgs.shellcheck
pkgs.statix
inputs.tryorama.packages.${system}.trycp-server
];
};
packages = [
pkgs.shellcheck
pkgs.statix
inputs.tryorama.packages.${system}.trycp-server
];
};

packages = {
default = config.workspace.workspace;
inherit (config.workspace) workspace;
};
packages = {
default = config.workspace.workspace;
inherit (config.workspace) workspace;
};

checks = {
inherit (config.workspace) workspace_clippy;
};
};
checks = {
inherit (config.workspace) workspace_clippy;
};
};
});
}
7 changes: 2 additions & 5 deletions nix/modules/formatter.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{ self, lib, ... }: {
perSystem = { config, self', inputs', pkgs, ... }: {
# define formatter used by `nix fmt`
formatter = pkgs.nixpkgs-fmt;
};
{ pkgs, ... }: {
formatter = pkgs.nixpkgs-fmt;
}
Loading

0 comments on commit 1253017

Please sign in to comment.