diff --git a/flake.lock b/flake.lock index 3daa762f..2d07ec2f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,15 +3,15 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1736937016, - "narHash": "sha256-dmLSu2SvSaTDjSE03cU6DwY62J3nWJbVhIn/kKtMwJg=", - "owner": "input-output-hk", + "lastModified": 1739645821, + "narHash": "sha256-HjAchUMLsiScm8Jyd+I/5YJKUjDp1r+XFzr05d+o+r4=", + "owner": "IntersectMBO", "repo": "cardano-haskell-packages", "rev": "045875beec586ff57a7333c0563fd5c2b1a308fa", "type": "github" }, "original": { - "owner": "input-output-hk", + "owner": "IntersectMBO", "ref": "repo", "repo": "cardano-haskell-packages", "type": "github" diff --git a/flake.nix b/flake.nix index b4022950..e672a00f 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.CHaP = { - url = "github:input-output-hk/cardano-haskell-packages?ref=repo"; + url = "github:IntersectMBO/cardano-haskell-packages?ref=repo"; flake = false; }; outputs = { self, nixpkgs, flake-utils, haskellNix, CHaP }: @@ -26,6 +26,41 @@ }; overlays = [ haskellNix.overlay + (final: prev: { + webkitgtk = final.webkitgtk_4_0; + libsodium = with final; stdenv.mkDerivation rec { + pname = "libsodium"; + + src = fetchGit { + url = "https://github.com/IntersectMBO/libsodium"; + rev = version; + }; + version = "dbb48cce5429cb6585c9034f002568964f1ce567"; + + nativeBuildInputs = [ autoreconfHook ]; + + configureFlags = [ "--enable-static" ] + # Fixes a compilation failure: "undefined reference to `__memcpy_chk'". Note + # that the more natural approach of adding "stackprotector" to + # `hardeningDisable` does not resolve the issue. + ++ lib.optional stdenv.hostPlatform.isMinGW "CFLAGS=-fno-stack-protector"; + + outputs = [ "out" "dev" ]; + separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl"; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with lib; { + description = "A modern and easy-to-use crypto library - VRF fork"; + homepage = "http://doc.libsodium.org/"; + license = licenses.isc; + maintainers = [ "tdammers" "nclarke" ]; + platforms = platforms.all; + }; + }; + }) (final: prev: { hixProject = final.haskell-nix.project' { @@ -34,16 +69,18 @@ # This is used by `nix develop .` to open a shell for use with # `cabal`, `hlint` and `haskell-language-server` shell.tools = { - cabal = {} ; + cabal = {}; hlint = {}; haskell-language-server = {}; # ghc-lib-parser doesnt compile with anything newer fourmolu = "0.17.0.0"; }; # Non-Haskell shell tools go here - shell.buildInputs = with pkgs; [ + shell.buildInputs = with final; [ nixpkgs-fmt ]; + # ???: Fix for `nix flake show --allow-import-from-derivation` + evalSystem = "x86_64-linux"; inputMap = { "https://chap.intersectmbo.org/" = CHaP; }; }; }) @@ -53,5 +90,16 @@ flake = pkgs.hixProject.flake {}; in flake // { legacyPackages = pkgs; + # Built by `nix build .` + packages.default = flake.packages."atlas-cardano:lib:atlas-cardano"; }); + # --- Flake Local Nix Configuration ---------------------------- + nixConfig = { + # This sets the flake to use the IOG nix cache. + # Nix should ask for permission before using it, + # but remove it here if you do not want it to. + extra-substituters = ["https://cache.iog.io"]; + extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="]; + allow-import-from-derivation = "true"; + }; }