commit 2b4a9d553de72a0e160d0ba672120969550b6ffb
parent 51f2d3656a75cfb7e4e91d79e726a25ba54bca63
Author: Jared Tobin <jared@jtobin.io>
Date: Mon, 19 Feb 2024 10:57:32 +0400
Add secp256k1-sys flake.
Diffstat:
2 files changed, 102 insertions(+), 0 deletions(-)
diff --git a/secp256k1-sys/flake.lock b/secp256k1-sys/flake.lock
@@ -0,0 +1,61 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1705309234,
+ "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1708247094,
+ "narHash": "sha256-H2VS7VwesetGDtIaaz4AMsRkPoSLEVzL/Ika8gnbUnE=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "045b51a3ae66f673ed44b5bbd1f4a341d96703bf",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixpkgs-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/secp256k1-sys/flake.nix b/secp256k1-sys/flake.nix
@@ -0,0 +1,41 @@
+{
+ description = "secp256k1-sys";
+
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ hpkgs = pkgs.haskell.packages.ghc964;
+ ghc = hpkgs.ghc;
+ cabal = hpkgs.cabal-install;
+
+ lib = "secp256k1-sys";
+ in
+ {
+ packages.${lib} = hpkgs.callCabal2nix lib self rec { };
+
+ defaultPackage = self.packages.${system}.${lib};
+
+ devShells.default = pkgs.mkShell {
+ buildInputs = [
+ cabal
+ ];
+
+ inputsFrom = builtins.attrValues self.packages.${system};
+
+ shellHook = ''
+ PS1="[nix] \w$ "
+ echo "entering shell, using"
+ echo "ghc: $(${ghc}/bin/ghc --version)"
+ echo "cabal: $(${cabal}/bin/cabal --version)"
+ '';
+ };
+ }
+ );
+}
+