diff --git a/README.md b/README.md index e24c56f67ca81a54798fb1684ee43dc7e945497b..fc048e7574d0b1cebf8702fe9352d690e82c6303 100644 --- a/README.md +++ b/README.md @@ -13,24 +13,38 @@ This package set has the following policy. * The following packages must always build: * plutus-tx -## Updating the Package set +## Updating the package set -The package set is generated from the `horizon.dhall` using the following command: +The package set is generated from the `horizon.dhall`. You can edit this in one +of two ways: manually using a text edit, or programatically using +`horizon-shell`. + +### Manual + +Edit the `horizon.dhall` file and add or change some package data. + +Run `horizon-gen-nix` from the remote repository. ``` nix run 'git+https://gitlab.horizon-haskell.net/haskell/horizon-gen-nix?ref=refs/tags/0.10.0' ``` -If you need to do additional manual overrides to the nix code, such as -`addPkgconfigDepends`, edit the `configuration.nix` overlay, which is applied -afterwards. - -## Programmmatic Updates +### Programatic To use `horizon-shell`. ``` -nix run 'git+https://gitlab.horizon-haskell.net/shells/horizon-shell?ref=refs/tags/0.0.7' +nix develop ``` See the in-shell help for usage. + +Warning - The dhall overlay here makes heavy use of let bindings, so if you do use any +programmatic updates, you will have to commit to fixing the formatter. + + +### Tweaking + +If you need to do additional manual overrides to the nix code, such as +`addPkgconfigDepends`, edit the `configuration/common.nix` overlay, which is +applied last. diff --git a/flake.lock b/flake.lock index e38f802eb8787bd82698089b69c7ee032028dcdf..4b9aaef77da78d5218feca275e71f013b2d3377b 100644 --- a/flake.lock +++ b/flake.lock @@ -126,6 +126,23 @@ "url": "https://gitlab.homotopic.tech/horizon/horizon-platform" } }, + "horizon-shell-flake": { + "flake": false, + "locked": { + "lastModified": 1679524452, + "narHash": "sha256-xzNxvLVa3o0F/z4CnBDORv2Y6PfxjlGv7b7LybIyCSg=", + "ref": "refs/tags/0.0.8", + "rev": "21b8913803cefeb287bb244c7ee335638233db7f", + "revCount": 21, + "type": "git", + "url": "https://gitlab.horizon-haskell.net/shells/horizon-shell" + }, + "original": { + "ref": "refs/tags/0.0.8", + "type": "git", + "url": "https://gitlab.horizon-haskell.net/shells/horizon-shell" + } + }, "lint-utils": { "inputs": { "flake-utils": "flake-utils_3", @@ -249,6 +266,7 @@ "flake-utils": "flake-utils", "get-flake": "get-flake", "horizon-platform": "horizon-platform", + "horizon-shell-flake": "horizon-shell-flake", "lint-utils": "lint-utils_2", "nixpkgs": "nixpkgs_4", "nixpkgs-libR": "nixpkgs-libR" diff --git a/flake.nix b/flake.nix index da2b482a33752a9dab4f02d6856fd46971e36ab3..4197c4b3703440d1e6749a44cb628a0702fa83b4 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,10 @@ inputs = { get-flake.url = "github:ursi/get-flake"; horizon-platform.url = "git+https://gitlab.homotopic.tech/horizon/horizon-platform"; + horizon-shell-flake = { + url = "git+https://gitlab.horizon-haskell.net/shells/horizon-shell?ref=refs/tags/0.0.8"; + flake = false; + }; lint-utils.url = "git+https://gitlab.homotopic.tech/nix/lint-utils"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-libR.url = "github:nixos/nixpkgs/602748c14b82a2e17078713686fe1df2824fa502"; @@ -20,6 +24,7 @@ , flake-utils , get-flake , horizon-platform + , horizon-shell-flake , lint-utils , nixpkgs , nixpkgs-libR @@ -34,6 +39,8 @@ with pkgs.writers; let + horizon-shell = get-flake horizon-shell-flake; + overrides = composeManyExtensions [ (import ./overlay.nix { inherit pkgs; }) (import ./configuration.nix { inherit pkgs pkgs-libR; }) @@ -49,6 +56,16 @@ && v.meta.broken == false) legacyPackages; + devShell = pkgs.mkShell { + buildInputs = [ + horizon-shell.packages.${system}.default + ]; + shellHook = '' + horizon-shell + exit + ''; + }; + in { @@ -57,8 +74,12 @@ nixpkgs-fmt = nixpkgs-fmt { src = self; find = "flake.nix"; }; }; + devShells.default = devShell; + inherit legacyPackages; + inherit overrides; + inherit packages; }); }