Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix flake update #6735

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions flake.lock

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

25 changes: 10 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
description = "Plutus Core";


inputs = {

iogx = {
Expand Down Expand Up @@ -31,22 +30,18 @@
};
};


outputs = inputs: inputs.iogx.lib.mkFlake {
inherit inputs;
repoRoot = ./.;
systems = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
outputs = import ./nix/outputs.nix;
};

outputs = inputs:
inputs.iogx.lib.mkFlake {
inherit inputs;
repoRoot = ./.;
systems = [ "x86_64-darwin" "x86_64-linux" "aarch64-darwin" ];
outputs = import ./nix/outputs.nix;
};

nixConfig = {
extra-substituters = [
"https://cache.iog.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
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;
};
}
64 changes: 24 additions & 40 deletions nix/agda.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ rec {
'';
});


# We want to keep control of which version of Agda we use, so we supply our own and override
# the one from nixpkgs.
#
Expand All @@ -42,39 +41,30 @@ rec {
# another GHC from nixpkgs! Sadly, this one is harder to override, and we just hack
# it into pkgs.haskellPackages in a fragile way. Annoyingly, this also means we have to ensure
# we have a few extra packages that it uses in our Haskell package set.
agda-packages =
let
Agda = agda-project.hsPkgs.Agda;

frankenAgdaBin = pkgs.symlinkJoin {
name = "agda";
version = Agda.identifier.version;
paths = [
Agda.components.exes.agda
Agda.components.exes.agda-mode
];
};
agda-packages = let
Agda = agda-project.hsPkgs.Agda;

frankenAgda = frankenAgdaBin // {
# Newer Agda is built with enableSeparateBinOutput, hence this hacky workaround.
# https://github.com/NixOS/nixpkgs/commit/294245f7501e0a8e69b83346a4fa5afd4ed33ab3
bin = frankenAgdaBin;
};
frankenAgdaBin = pkgs.symlinkJoin {
name = "agda";
version = Agda.identifier.version;
paths = [ Agda.components.exes.agda Agda.components.exes.agda-mode ];
};

frankenPkgs =
pkgs //
{
haskellPackages = pkgs.haskellPackages //
{
inherit (agda-project) ghcWithPackages;
};
};
in
pkgs.agdaPackages.override {
Agda = frankenAgda;
pkgs = frankenPkgs;
frankenAgda = frankenAgdaBin // {
# Newer Agda is built with enableSeparateBinOutput, hence this hacky workaround.
# https://github.com/NixOS/nixpkgs/commit/294245f7501e0a8e69b83346a4fa5afd4ed33ab3
bin = frankenAgdaBin;
};

frankenPkgs = pkgs // {
haskellPackages = pkgs.haskellPackages // {
inherit (agda-project) ghcWithPackages;
};
};
in pkgs.agdaPackages.override {
Agda = frankenAgda;
pkgs = frankenPkgs;
};

# Agda is a huge pain. They have a special custom setup that compiles the
# interface files for the Agda that ships with the compiler. These go in
Expand All @@ -91,7 +81,8 @@ rec {
# to pass it in.
agda-project-module-patch = { compiler-nix-name }: {
packages.Agda.package.buildType = lib.mkForce "Simple";
packages.Agda.components.library.enableSeparateDataOutput = lib.mkForce true;
packages.Agda.components.library.enableSeparateDataOutput =
lib.mkForce true;
packages.Agda.components.library.postInstall = ''
# Compile the executable using the package DB we've just made, which contains
# the main Agda library
Expand All @@ -108,20 +99,15 @@ rec {
'';
};


agda-project-module-patch-default = agda-project-module-patch {
compiler-nix-name = "ghc";
};

agda-project-module-patch-default =
agda-project-module-patch { compiler-nix-name = "ghc"; };

agda-project-module-patch-musl64 = agda-project-module-patch {
compiler-nix-name = "x86_64-unknown-linux-musl-ghc";
};


agda-with-stdlib = agda-packages.agda.withPackages [ agda-stdlib ];


agda-project = pkgs.haskell-nix.hackage-project {
name = "Agda";
version = "2.7.0";
Expand All @@ -130,15 +116,13 @@ rec {
modules = [ agda-project-module-patch-default ];
};


# TODO this is a bit of a hack, but it's the only way to get the uplc
# executable to find the metatheory and the stdandard library.
shell-hook-exports = ''
export AGDA_STDLIB_SRC="${agda-stdlib}/src"
export PLUTUS_METHATHEORY_SRC="./plutus-metatheory/src"
'';


wrap-program-args = ''
--set AGDA_STDLIB_SRC "${agda-stdlib}/src" \
--set PLUTUS_METHATHEORY_SRC "./plutus-metatheory/src"
Expand Down
Loading
Loading