From ed35645d28d5d83ac462c5c2a1158971b220bbcd Mon Sep 17 00:00:00 2001 From: t4ccer Date: Thu, 22 Feb 2024 18:08:06 -0700 Subject: [PATCH] Remove Nix Plutarch wrapper --- default.nix | 15 +++++++++++-- flake.nix | 1 - nix/haskell/mk-hackage.nix | 2 ++ nix/plutarch/default.nix | 28 ------------------------ nix/plutarch/lib.nix | 44 -------------------------------------- 5 files changed, 15 insertions(+), 75 deletions(-) delete mode 100644 nix/plutarch/default.nix delete mode 100644 nix/plutarch/lib.nix diff --git a/default.nix b/default.nix index 83f611fb..4ff7fc51 100644 --- a/default.nix +++ b/default.nix @@ -1,9 +1,20 @@ { - perSystem = { self', config, ... }: + perSystem = { self', pkgs, config, ... }: let - purus = config.libPlutarch.mkPackage { + cardanoPackages = pkgs.fetchFromGitHub { + owner = "input-output-hk"; + repo = "cardano-haskell-packages"; + rev = "3df392af2a61d61bdac1afd9c3674f27d6aa8efc"; # branch: repo + hash = "sha256-vvm56KzA6jEkG3mvwh1LEdK4H4FKxeoOJNz90H8l8dQ="; + }; + + purus = config.libHaskell.mkPackage { name = "purus"; src = ./.; + + externalRepositories = { + "https://input-output-hk.github.io/cardano-haskell-packages" = cardanoPackages; + }; }; in { diff --git a/flake.nix b/flake.nix index 9552252a..555cfe2e 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,6 @@ let flakeModules = { haskell = ./nix/haskell; - plutarch = ./nix/plutarch; utils = ./nix/utils; }; in diff --git a/nix/haskell/mk-hackage.nix b/nix/haskell/mk-hackage.nix index 9bd43db8..fc89862f 100644 --- a/nix/haskell/mk-hackage.nix +++ b/nix/haskell/mk-hackage.nix @@ -1,3 +1,5 @@ +# Adapted from https://github.com/mlabs-haskell/mlabs-tooling.nix/blob/cd0cf0d29f17980befe384248c16937589912c69/mk-hackage.nix + { gzip , runCommand , lib diff --git a/nix/plutarch/default.nix b/nix/plutarch/default.nix deleted file mode 100644 index afb64fb4..00000000 --- a/nix/plutarch/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib -, flake-parts-lib -, ... -}: -let - inherit (flake-parts-lib) mkPerSystemOption; -in -{ - options = { - perSystem = mkPerSystemOption ({ config, pkgs, ... }: { - options = { - libPlutarch = lib.mkOption { - type = lib.types.anything; - default = { }; - }; - }; - - config = { - libPlutarch = { - mkPackage = pkgs.callPackage ./lib.nix { - mkHaskellPackage = config.libHaskell.mkPackage; - inherit (config.libUtils) applyPatches; - }; - }; - }; - }); - }; -} diff --git a/nix/plutarch/lib.nix b/nix/plutarch/lib.nix deleted file mode 100644 index 3ec84f23..00000000 --- a/nix/plutarch/lib.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ fetchFromGitHub -, mkHaskellPackage -, applyPatches -, fetchpatch -}: - -let - plutarchPackage = applyPatches { - name = "plutarch-patched"; - src = fetchFromGitHub { - owner = "Plutonomicon"; - repo = "plutarch-plutus"; - rev = "288d9140468ae98abe1c9a4c0bb1c19a82eb7cd6"; # branch: master - hash = "sha256-aeaZMW5Y3r5GdSyrfrrKOuGahcL5MVkDUNggunbmtv0="; - }; - - patches = [ - # https://github.com/Plutonomicon/plutarch-plutus/pull/650 - (fetchpatch { - url = "https://github.com/Plutonomicon/plutarch-plutus/commit/7256acb8db3230d2453460f0358582283c69da5f.patch"; - hash = "sha256-y/F1ZwLDC5E4vh8F+JTQStHJsQ1ZEe9LIZcwSGMSUek="; - }) - ]; - }; - - cardanoPackages = fetchFromGitHub { - owner = "input-output-hk"; - repo = "cardano-haskell-packages"; - rev = "3df392af2a61d61bdac1afd9c3674f27d6aa8efc"; # branch: repo - hash = "sha256-vvm56KzA6jEkG3mvwh1LEdK4H4FKxeoOJNz90H8l8dQ="; - }; -in - -args: -mkHaskellPackage (args // { - externalRepositories = { - "https://input-output-hk.github.io/cardano-haskell-packages" = cardanoPackages; - } // (args.externalRepositories or { }); - - externalDependencies = [ - "${plutarchPackage}" - "${plutarchPackage}/plutarch-extra" - ] ++ (args.externalDependencies or [ ]); -})