Skip to content

Commit

Permalink
Adapt and clean up nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
HeinrichApfelmus committed Nov 19, 2024
1 parent 01830aa commit 417ef51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 43 deletions.
3 changes: 0 additions & 3 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ package cardano-wallet
package cardano-wallet-api
tests: True

package cardano-wallet-cli
tests: True

package cardano-wallet-launcher
tests: True

Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
inherit system;
inherit (haskellNix) config;
overlays = [
# Meh. It looks like iohkNix is outdated
# things no longer work.
# Not sure what to do about ./regenerate.sh
(final: prev: { nixFlakes = prev.nixVersions.stable; })
iohkNix.overlays.utils
iohkNix.overlays.crypto
iohkNix.overlays.cardano-lib
Expand Down
40 changes: 0 additions & 40 deletions nix/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
curlFull
jq
yq
nixWrapped
mdbook
haskellPackages.fourmolu
haskellPackages.ghcid
Expand All @@ -164,10 +163,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
[
{
packages = lib.genAttrs projectPackages (name: {
# Mark package as local non-dep in the nix-shell.
# fixme: Haskell.nix should set it
package.isProject = true;

# Enable release flag (optimization and -Werror)
flags.release = true;

Expand All @@ -185,16 +180,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
{
reinstallableLibGhc = true;

# These are here to make `stackProject` vs `cabalProject` `nix-diff` cleaner
# TODO remove
packages.entropy.components.setup.doExactConfig = true;
packages.prettyprinter-configurable.components.setup.doExactConfig = true;
packages.pretty-simple.components.setup.doExactConfig = true;
packages.wai-logger.components.setup.doExactConfig = true;
packages.openapi3.components.setup.doExactConfig = true;
packages.servant-openapi3.components.setup.doExactConfig = true;
packages.system-filepath.components.setup.doExactConfig = true;

packages.cardano-wallet-unit.components.tests = {
unit.build-tools = cardanoNodeExes;
unit.preCheck = noCacheTestFailuresCookie + ''
Expand Down Expand Up @@ -286,26 +271,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
packages.cardano-wallet.components.exes.cardano-wallet.postInstall = optparseCompletionPostInstall + setGitRevPostInstall + rewriteLibsPostInstall + stripBinariesPostInstall;
})

({ config, ... }:
let
setGitRevPostInstall = setGitRevPostInstall' config.packages.cardano-node.src.rev;
in
{
# Add shell completions for tools.
packages.cardano-cli.components.exes.cardano-cli.postInstall = optparseCompletionPostInstall + setGitRevPostInstall;
packages.cardano-node.components.exes.cardano-node.postInstall = optparseCompletionPostInstall + setGitRevPostInstall;
packages.cardano-addresses-cli.components.exes.cardano-address.postInstall = optparseCompletionPostInstall;
packages.bech32.components.exes.bech32.postInstall = optparseCompletionPostInstall;
})

# Provide the git revision for cardano-addresses
({ config, ... }:
{
packages.cardano-addresses-cli.components.library.preBuild = ''
export GITREV=${config.hsPkgs.cardano-addresses-cli.src.rev}
'';
})

# Provide the swagger file in an environment variable for
# tests because it is located outside of the Cabal package
# source tree.
Expand All @@ -319,7 +284,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
# Use our forked libsodium from iohk-nix crypto overlay.
packages.plutus-tx.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.byron-spec-ledger.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-wallet-cli.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-crypto-praos.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 ] ];
packages.cardano-crypto-class.components.library.pkgconfig = lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 pkgs.libblst ] ];
})
Expand Down Expand Up @@ -371,10 +335,6 @@ CHaP: haskell-nix: nixpkgs-recent: nodePkgs: haskell-nix.cabalProject' [
packages.cardano-wallet-benchmarks.components.benchmarks.db = fullyStaticOptions;
packages.cardano-wallet-launcher.components.tests.unit = fullyStaticOptions;

# systemd can't be statically linked - disable lobemo-scribe-journal
packages.cardano-config.flags.systemd = false;
packages.cardano-node.flags.systemd = false;

# Haddock not working for cross builds and is not needed anyway
doHaddock = false;
}
Expand Down

0 comments on commit 417ef51

Please sign in to comment.