Holo Nixpkgs Save Abandoned

Modules, packages and profiles that drive Holo, Holochain, and HoloPortOS

Project README

Holo Nixpkgs

initial implementation for infrastructure 4

Modules, packages and profiles that drive Holo hosting, Holochain, and HoloPortOS.

Test suite

holo-nixpkgs provides a set of NixOS tests found under /tests.

Running tests

To run all the tests, run the following command from repository root:

nix-build tests

To run a specific test, add -A <test-directory>, e.g.

nix-build tests -A hpos-holochain-api

Writing tests

NixOS manual has a comprehensive entry on test syntax and available functions.

To add a new test:

  1. Create a new file under tests/<test-directory>/default.nix using the following template:
default.nix template
{ makeTest, lib, hpos, /* additional packages */ ... }:

makeTest {
  name = "<test-name>";

  machine = {
    imports = [ (import "${hpos.logical}/sandbox") ];

    documentation.enable = false;

    environment.systemPackages = [
      # additional packages
    ];

    # Any test-specific NixOS configuration goes here
    # e.g. services.<name>.enable = true;

    virtualisation.memorySize = 3072;
  };

  testScript = ''
    start_all()

    # Your test script goes here
    # For syntax, consult NixOS manual on writing tests and other tests in /tests directory, e.g.
    # machine.succeed("command-to-test --foo bar")
  '';

  meta.platforms = [ "x86_64-linux" ];
}
  1. Add a new attribute to the bottom-most block in /tests/default.nix, e.g.
{
  # <snip>
  test-name = callPackage ./<test-directory> {};
}
  1. Make sure the test works by running it on a NixOS machine:
nix-build tests -A <test-name>

Binary cache

On NixOS, add the following to /etc/nixos/configuration.nix and rebuild:

{
  nix.binaryCaches = [
    "https://cache.holo.host/"
  ];

  nix.binaryCachePublicKeys = [
    "cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE="
    "cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ="
  ];
}

Otherwise, add or adjust the following configuration settings to the Nix config file:

extra-substituters = https://cache.holo.host/
trusted-public-keys = cache.holo.host-1:lNXIXtJgS9Iuw4Cu6X0HINLu9sTfcjEntnrgwMQIMcE= cache.holo.host-2:ZJCkX3AUYZ8soxTLfTb60g+F3MkWD7hkH9y8CgqwhDQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

For single-user installs (nix-shell -p nix-info --run nix-info prints multi-user: no), Nix config file is in ~/.config/nix/nix.conf.

Otherwise, for multi-user installs, Nix config file is in /etc/nix/nix.conf and changing it requires root access.

HoloPortOS

HoloportOS is an operating system based on NixOS that supports running Holochain applications.

Changing HPOS to Track develop vs. master

On your HoloPort or HPOS VM, the following command will alter your subscribed nix channel.

To track develop:

  • nix-channel --add https://hydra.holo.host/channel/custom/holo-nixpkgs/develop/holo-nixpkgs
  • nix-channel --update (change develop above to appropriate repo branch... e.g. master, staging)

Your HoloPort or HPOS VM should now upgrade to your desired channel at the next auto-upgrade interval.

To begin the upgrade immediately, use the following command:

  • systemctl start holo-nixpkgs-auto-upgrade.service

QEMU

If you have Nix installed, checkout the repo, enter nix-shell and then hpos-shell is available to you. Usage:

hpos-shell <attr>

starts HPOS VM against local checkout of given profile.

where <attr> is one of the attributes of hpos from overlays. If no value given defaults to qemu. For example hpos-shell tests will start HPOS VM with the profile defined as in holo-nixpkgs.hpos.test.

Very useful for iterative local development.

VirtualBox

Download the latest HoloPortOS VirtualBox OVA: https://hydra.holo.host/job/holo-nixpkgs/master/holoportos.targets.virtualbox.x86_64-linux/latest/download-by-type/file/ova

Refer to VirtualBox manual, chapter 1, section 1.15.2.

HPOS profiles

There's a number of profiles you can activate on your HPOS that alter behavior of your machine. Instructions, list of profiles and their features can be found in profiles/logical/hpos/README.md.

Running nightly test for your PR

When you create a PR for your change you will notice that one of the checks will not run automatically. To run nightly tests for you PR do the following:

  • Copy your PR#
  • Go to the Actions for the holo-nixpkgs repo
  • Select "Holo Nightly Test" in the side menu (or use this link)
  • Click on the "Run workflow" select
  • Input your PR# in the input below the dropdown
  • Click "Run workflow"

NOTE: Nightly tests should always use workflow from develop branch

Enabling Membrane Proof on DevNet

Membrane proof is requested on devNet when a new agent pub key is created.

If an already existing agent pub key is used the above mentioned step will be skipped. This means the membrane proof might not be correct. To resolve this you can either remove your agent pub key to generate a new one or update the UID causing a new membrane proof to be fetched.

Open Source Agenda is not affiliated with "Holo Nixpkgs" Project. README Source: Holo-Host/holo-nixpkgs
Stars
41
Open Issues
29
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating