From 58b882df0dad5388ef5eedc65953067f118a18c0 Mon Sep 17 00:00:00 2001 From: Yura Lazaryev Date: Tue, 8 Oct 2024 11:52:42 +0200 Subject: [PATCH] Fix Agda-related nix shell error and add texlive --- nix/agda-packages.nix | 31 +++++++++++++++++++------------ nix/shell.nix | 3 +++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/nix/agda-packages.nix b/nix/agda-packages.nix index 085e0e0d157..7d6d4e4ac4f 100644 --- a/nix/agda-packages.nix +++ b/nix/agda-packages.nix @@ -1,4 +1,10 @@ -{ repoRoot, inputs, pkgs, system, lib }: +{ repoRoot +, inputs +, pkgs +, system +, lib +, +}: # We want to keep control of which version of Agda we use, so we supply our own and override # the one from nixpkgs. @@ -18,25 +24,26 @@ let Agda = repoRoot.nix.agda-project.hsPkgs.Agda; - frankenAgda = (pkgs.symlinkJoin { + frankenAgdaBin = pkgs.symlinkJoin { name = "agda"; + version = Agda.identifier.version; paths = [ Agda.components.exes.agda Agda.components.exes.agda-mode ]; - }) // - { - version = Agda.identifier.version; }; - frankenPkgs = - pkgs // - { - haskellPackages = pkgs.haskellPackages // - { - inherit (repoRoot.nix.agda-project) ghcWithPackages; - }; + 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 (repoRoot.nix.agda-project) ghcWithPackages; }; + }; in pkgs.agdaPackages.override { diff --git a/nix/shell.nix b/nix/shell.nix index ac42e3522c8..17c810798cc 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -35,6 +35,9 @@ in repoRoot.nix.r-with-packages pkgs.R + # LaTeX environment + pkgs.texlive + # Misc useful stuff, could make these commands but there's a lot already pkgs.jekyll pkgs.plantuml