From b759e5ff3beda2e15ad3797073829de7ac1adf1a Mon Sep 17 00:00:00 2001 From: David Meister Date: Tue, 9 Jul 2019 21:03:52 +1000 Subject: [PATCH] holonix 0.0.12 support --- config.nix | 43 +++++++++++++++++++++++++++++++++ default.nix | 68 ++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 100 insertions(+), 11 deletions(-) create mode 100644 config.nix diff --git a/config.nix b/config.nix new file mode 100644 index 0000000..7a8b91f --- /dev/null +++ b/config.nix @@ -0,0 +1,43 @@ +{ + release = { + # the commit hash that the release process should target + # this will always be behind what ends up being deployed + # the release process needs to add some commits for changelog etc. + commit = "0095ae8451d954ca4fef76aac76c4aa40add0dad"; + + # the semver for prev and current releases + # the previous version will be scanned/bumped by release scripts + # the current version is what the release scripts bump *to* + version = { + current = "0.0.2"; + previous = "0.0.1-alpha2"; + }; + + github = { + # markdown to inject into github releases + # there is some basic string substitution {{ xxx }} + # - {{ changelog }} will inject the changelog as at the target commit + template = '' +{{ changelog }} + +# Installation + +Use Holonix to work with this repository. + +See: + +- https://github.com/holochain/holonix +- https://nixos.org/ +''; + + # owner of the github repository that release are deployed to + owner = "holochain"; + + # repository name on github that release are deployed to + repo = "holochain-serialization"; + + # canonical local upstream name as per `git remote -v` + upstream = "origin"; + }; + }; +} diff --git a/default.nix b/default.nix index 9054668..448ffe5 100644 --- a/default.nix +++ b/default.nix @@ -1,20 +1,66 @@ +# This is an example of what downstream consumers of holonix should do +# This is also used to dogfood as many commands as possible for holonix +# For example the release process for holonix uses this file let - holonix-release-tag = "0.0.4"; - holonix-release-sha256 = "04xbhr0w0fc911vjd4f42shmy3vlnvwpicjnsk0q8gr4prkpz74h"; - holonix = import (fetchTarball { - url = "https://github.com/holochain/holonix/tarball/${holonix-release-tag}"; - sha256 = "${holonix-release-sha256}"; - }); - # uncomment to work locally - # holonix = import ../holonix; + # point this to your local config.nix file for this project + # example.config.nix shows and documents a lot of the options + project-config = import ./config.nix; + + config = { + + # true = use a github repository as the holonix base (recommended) + # false = use a local copy of holonix (useful for debugging) + use-github = true; + + # configure the remote holonix github when use-github = true + github = { + + # can be any github ref + # branch, tag, commit, etc. + ref = "0.0.12"; + + # the sha of what is downloaded from the above ref + # note: even if you change the above ref it will not be redownloaded until + # the sha here changes (the sha is the cache key for downloads) + # note: to get a new sha, get nix to try and download a bad sha + # it will complain and tell you the right sha + sha256 = "1hlfd2vr8x0faa8d8zhrnkqadvn6wmvwnl9zl920vb1p08qg24ka"; + + # the github owner of the holonix repo + owner = "holochain"; + + # the name of the holonix repo + repo = "holonix"; + }; + + # configuration for when use-github = false + local = { + # the path to the local holonix copy + path = ./.; + }; + + }; + + # START HOLONIX IMPORT BOILERPLATE + holonix = import ( + if ! config.use-github + then config.local.path + else fetchTarball { + url = "https://github.com/${config.github.owner}/${config.github.repo}/tarball/${config.github.ref}"; + sha256 = config.github.sha256; + } + ) { config = project-config; }; + # END HOLONIX IMPORT BOILERPLATE + + # holonix = callPackage ../holonix { config = (import ./config.nix) }; in with holonix.pkgs; { - core-shell = stdenv.mkDerivation (holonix.shell // { - name = "holochain-serialization-shell"; + dev-shell = stdenv.mkDerivation (holonix.shell // { + name = "dev-shell"; - buildInputs = [] + buildInputs = [ ] ++ holonix.shell.buildInputs ++ (holonix.pkgs.callPackage ./test { pkgs = holonix.pkgs;