update flake

This commit is contained in:
Peter Dragos 2022-03-24 17:13:44 -04:00
parent 1ef2a41df7
commit bbddc5e34b
No known key found for this signature in database
GPG key ID: D21EAEED5EBE475E
4 changed files with 84 additions and 73 deletions

View file

@ -15,14 +15,14 @@ import Plutarch.Api.V1 (
PAddress (..), PAddress (..),
PCredential (..), PCredential (..),
PCurrencySymbol (..), PCurrencySymbol (..),
PMap (..),
PScriptContext (..), PScriptContext (..),
PScriptPurpose (..), PScriptPurpose (..),
PTxInInfo (..), PTxInInfo (..),
PTxInfo (..), PTxInfo (..),
PTxOut (..), PTxOut (..),
PValue (..),
) )
import Plutarch.Api.V1.AssocMap (PMap (PMap))
import Plutarch.Api.V1.Value (PValue (PValue))
import Plutarch.Builtin (pforgetData) import Plutarch.Builtin (pforgetData)
import Plutarch.List (pfoldr') import Plutarch.List (pfoldr')
import Plutarch.Monadic qualified as P import Plutarch.Monadic qualified as P

View file

@ -41,7 +41,6 @@ import Plutarch.Api.V1 (
PCurrencySymbol, PCurrencySymbol,
PDatum, PDatum,
PDatumHash, PDatumHash,
PMap (PMap),
PMaybeData (PDJust), PMaybeData (PDJust),
PPubKeyHash, PPubKeyHash,
PTokenName, PTokenName,
@ -50,8 +49,9 @@ import Plutarch.Api.V1 (
PTxInfo (PTxInfo), PTxInfo (PTxInfo),
PTxOut (PTxOut), PTxOut (PTxOut),
PTxOutRef, PTxOutRef,
PValue (PValue),
) )
import Plutarch.Api.V1.AssocMap (PMap (PMap))
import Plutarch.Api.V1.Value (PValue (PValue))
import Plutarch.Builtin (ppairDataBuiltin) import Plutarch.Builtin (ppairDataBuiltin)
import Plutarch.Internal (punsafeCoerce) import Plutarch.Internal (punsafeCoerce)
import Plutarch.Monadic qualified as P import Plutarch.Monadic qualified as P

33
flake.lock generated
View file

@ -679,7 +679,7 @@
"nixpkgs": [ "nixpkgs": [
"apropos-tx", "apropos-tx",
"haskell-nix", "haskell-nix",
"nixpkgs-2105" "nixpkgs-unstable"
], ],
"nixpkgs-2003": "nixpkgs-2003", "nixpkgs-2003": "nixpkgs-2003",
"nixpkgs-2105": "nixpkgs-2105", "nixpkgs-2105": "nixpkgs-2105",
@ -731,6 +731,8 @@
"hpc-coveralls": "hpc-coveralls_2", "hpc-coveralls": "hpc-coveralls_2",
"nix-tools": "nix-tools_2", "nix-tools": "nix-tools_2",
"nixpkgs": [ "nixpkgs": [
"plutarch",
"haskell-nix",
"nixpkgs-2111" "nixpkgs-2111"
], ],
"nixpkgs-2003": "nixpkgs-2003_2", "nixpkgs-2003": "nixpkgs-2003_2",
@ -1123,6 +1125,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-2111_4": {
"locked": {
"lastModified": 1647902355,
"narHash": "sha256-SySJ8IRaogpc/BPOkysA+kzq9URvXthoeKIemaTKCiM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "31aa631dbc496500efd2507baaed39626f6650f2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-21.11-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-nixops": { "nixpkgs-nixops": {
"locked": { "locked": {
"lastModified": 1630248577, "lastModified": 1630248577,
@ -1274,6 +1292,7 @@
"haskell-nix", "haskell-nix",
"nixpkgs-unstable" "nixpkgs-unstable"
], ],
"nixpkgs-2111": "nixpkgs-2111_4",
"plutus": "plutus_2", "plutus": "plutus_2",
"protolude": "protolude", "protolude": "protolude",
"safe-coloured-text": "safe-coloured-text", "safe-coloured-text": "safe-coloured-text",
@ -1283,17 +1302,17 @@
"validity": "validity" "validity": "validity"
}, },
"locked": { "locked": {
"lastModified": 1646941827, "lastModified": 1648145467,
"narHash": "sha256-/TmkSDVOYD0Nsf6/tsyCSWhFUIeefwPn0Lz1oeZ7lyQ=", "narHash": "sha256-yrq0CJbZPrDmrEeI/RqNmKGHoHasMsnknug7kPLUsRU=",
"owner": "Plutonomicon", "owner": "peter-mlabs",
"repo": "plutarch", "repo": "plutarch",
"rev": "cb29ca64df4ed193d94a062e3fe26aa37e59b7bc", "rev": "2ddf1d1b6efc43598ca3502471f6ace596f920ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "Plutonomicon", "owner": "peter-mlabs",
"ref": "liqwid/extra",
"repo": "plutarch", "repo": "plutarch",
"rev": "cb29ca64df4ed193d94a062e3fe26aa37e59b7bc",
"type": "github" "type": "github"
} }
}, },

116
flake.nix
View file

@ -3,6 +3,12 @@
inputs.nixpkgs.follows = "plutarch/nixpkgs"; inputs.nixpkgs.follows = "plutarch/nixpkgs";
inputs.haskell-nix.follows = "plutarch/haskell-nix"; inputs.haskell-nix.follows = "plutarch/haskell-nix";
# temporary fix for nix versions that have the transitive follows bug
# see https://github.com/NixOS/nix/issues/6013
inputs.nixpkgs-2111 = { url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; };
inputs.plutarch.url = "github:peter-mlabs/plutarch/liqwid/extra";
inputs.plutarch.inputs.nixpkgs.follows = "plutarch/haskell-nix/nixpkgs-unstable";
# https://github.com/mlabs-haskell/apropos-tx/pull/28 # https://github.com/mlabs-haskell/apropos-tx/pull/28
inputs.apropos-tx.url = inputs.apropos-tx.url =
@ -10,48 +16,33 @@
inputs.apropos-tx.inputs.nixpkgs.follows = inputs.apropos-tx.inputs.nixpkgs.follows =
"plutarch/haskell-nix/nixpkgs-unstable"; "plutarch/haskell-nix/nixpkgs-unstable";
# temporary fix for nix versions that have the transitive follows bug
# see https://github.com/NixOS/nix/issues/6013
inputs.nixpkgs-2111 = { url = "github:NixOS/nixpkgs/nixpkgs-21.11-darwin"; };
inputs.plutarch.url =
"github:Plutonomicon/plutarch?rev=cb29ca64df4ed193d94a062e3fe26aa37e59b7bc";
inputs.plutarch.inputs.nixpkgs.follows =
"plutarch/haskell-nix/nixpkgs-unstable";
outputs = inputs@{ self, nixpkgs, haskell-nix, plutarch, ... }: outputs = inputs@{ self, nixpkgs, haskell-nix, plutarch, ... }:
let let
supportedSystems = with nixpkgs.lib.systems.supported; supportedSystems = with nixpkgs.lib.systems.supported; tier1 ++ tier2 ++ tier3;
tier1 ++ tier2 ++ tier3;
perSystem = nixpkgs.lib.genAttrs supportedSystems; perSystem = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = system: nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ haskell-nix.overlay ]; inherit (haskell-nix) config; };
import nixpkgs { nixpkgsFor' = system: import nixpkgs { inherit system; inherit (haskell-nix) config; };
inherit system;
overlays = [ haskell-nix.overlay ];
inherit (haskell-nix) config;
};
nixpkgsFor' = system:
import nixpkgs {
inherit system;
inherit (haskell-nix) config;
};
ghcVersion = "ghc921"; ghcVersion = "ghc921";
projectFor = system: projectFor = system:
let pkgs = nixpkgsFor system; let pkgs = nixpkgsFor system; in
in let pkgs' = nixpkgsFor' system; let pkgs' = nixpkgsFor' system; in
in (nixpkgsFor system).haskell-nix.cabalProject' { (nixpkgsFor system).haskell-nix.cabalProject' {
src = ./.; src = ./.;
compiler-nix-name = ghcVersion; compiler-nix-name = ghcVersion;
inherit (plutarch) cabalProjectLocal; inherit (plutarch) cabalProjectLocal;
extraSources = plutarch.extraSources ++ [ extraSources = plutarch.extraSources ++ [
{ {
src = inputs.plutarch; src = inputs.plutarch;
subdirs = [ "." "plutarch-test" "plutarch-extra" ]; subdirs = [
"."
"plutarch-test"
"plutarch-extra"
"plutarch-numeric"
];
} }
{ {
src = inputs.apropos-tx; src = inputs.apropos-tx;
@ -66,24 +57,28 @@
# We use the ones from Nixpkgs, since they are cached reliably. # We use the ones from Nixpkgs, since they are cached reliably.
# Eventually we will probably want to build these with haskell.nix. # Eventually we will probably want to build these with haskell.nix.
nativeBuildInputs = [ nativeBuildInputs = with pkgs';
pkgs'.git [
pkgs'.haskellPackages.apply-refact entr
pkgs'.fd haskellPackages.apply-refact
pkgs'.cabal-install git
pkgs'.haskell.packages."${ghcVersion}".hlint fd
pkgs'.haskellPackages.cabal-fmt cabal-install
pkgs'.nixpkgs-fmt hlint
pkgs'.graphviz haskellPackages.cabal-fmt
]; nixpkgs-fmt
graphviz
];
inherit (plutarch) tools; inherit (plutarch) tools;
additional = ps: [ additional = ps: [
ps.plutarch ps.plutarch
ps.plutarch-test ps.tasty-quickcheck
ps.apropos-tx ps.apropos-tx
ps.plutarch-extra ps.plutarch-extra
ps.plutarch-numeric
ps.plutarch-test
]; ];
}; };
}; };
@ -92,45 +87,42 @@
let let
pkgs = nixpkgsFor system; pkgs = nixpkgsFor system;
pkgs' = nixpkgsFor' system; pkgs' = nixpkgsFor' system;
inherit (pkgs.haskell-nix.tools ghcVersion { in
inherit (plutarch.tools) fourmolu hlint; pkgs.runCommand "format-check"
}) {
fourmolu hlint; nativeBuildInputs = [ pkgs'.git pkgs'.fd pkgs'.haskellPackages.cabal-fmt pkgs'.nixpkgs-fmt (pkgs.haskell-nix.tools ghcVersion { inherit (plutarch.tools) fourmolu; }).fourmolu ];
in pkgs.runCommand "format-check" { } ''
nativeBuildInputs = [
pkgs'.git
pkgs'.fd
pkgs'.haskellPackages.cabal-fmt
pkgs'.nixpkgs-fmt
fourmolu
hlint
];
} ''
export LC_CTYPE=C.UTF-8 export LC_CTYPE=C.UTF-8
export LC_ALL=C.UTF-8 export LC_ALL=C.UTF-8
export LANG=C.UTF-8 export LANG=C.UTF-8
cd ${self} cd ${self}
make format_check make format_check
mkdir $out mkdir $out
''; ''
in { ;
in
{
project = perSystem projectFor; project = perSystem projectFor;
flake = perSystem (system: (projectFor system).flake { }); flake = perSystem (system: (projectFor system).flake { });
packages = perSystem (system: self.flake.${system}.packages); packages = perSystem (system: self.flake.${system}.packages);
checks = perSystem (system: checks = perSystem (system:
self.flake.${system}.checks // { self.flake.${system}.checks
// {
formatCheck = formatCheckFor system; formatCheck = formatCheckFor system;
}); }
);
check = perSystem (system: check = perSystem (system:
(nixpkgsFor system).runCommand "combined-test" { (nixpkgsFor system).runCommand "combined-test"
checksss = builtins.attrValues self.checks.${system}; {
} '' checksss = builtins.attrValues self.checks.${system};
} ''
echo $checksss echo $checksss
touch $out touch $out
''); ''
);
devShell = perSystem (system: self.flake.${system}.devShell); devShell = perSystem (system: self.flake.${system}.devShell);
defaultPackage =
perSystem (system: self.flake.${system}.packages."agora:lib:agora");
}; };
} }