Skip to content

Commit

Permalink
feat: update nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Pitometsu-GeniusYield committed Feb 25, 2025
1 parent e42ddba commit 0541c96
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 7 deletions.
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 51 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 }:
Expand All @@ -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' {
Expand All @@ -34,15 +69,17 @@
# 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 = {};
fourmolu = {};
};
# 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; };
};
})
Expand All @@ -52,5 +89,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";
};
}

0 comments on commit 0541c96

Please sign in to comment.