+14
-31
doc/languages-frameworks/agda.section.md
+14
-31
doc/languages-frameworks/agda.section.md
···-To write a nix derivation for an Agda library, first check that the library has a `*.agda-lib` file.+To write a nix derivation for an Agda library, first check that the library has a (single) `*.agda-lib` file.A derivation can then be written using `agdaPackages.mkDerivation`. This has similar arguments to `stdenv.mkDerivation` with the following additions:-* `everythingFile` can be used to specify the location of the `Everything.agda` file, defaulting to `./Everything.agda`. If this file does not exist then either it should be patched in or the `buildPhase` should be overridden (see below).* `libraryName` should be the name that appears in the `*.agda-lib` file, defaulting to `pname`.* `libraryFile` should be the file name of the `*.agda-lib` file, defaulting to `${libraryName}.agda-lib`.···-The default build phase for `agdaPackages.mkDerivation` runs `agda` on the `Everything.agda` file.If something else is needed to build the package (e.g. `make`) then the `buildPhase` should be overridden.-Additionally, a `preBuild` or `configurePhase` can be used if there are steps that need to be done prior to checking the `Everything.agda` file.+Additionally, a `preBuild` or `configurePhase` can be used if there are steps that need to be done prior to checking the library.`agda` and the Agda libraries contained in `buildInputs` are made available during the build phase.···-To add an Agda package to `nixpkgs`, the derivation should be written to `pkgs/development/libraries/agda/${library-name}/` and an entry should be added to `pkgs/top-level/agda-packages.nix`. Here it is called in a scope with access to all other Agda libraries, so the top line of the `default.nix` can look like:+To add an Agda package to `nixpkgs`, the derivation should be written to `pkgs/development/libraries/agda/${library-name}/default.nix` and an entry should be added to `pkgs/top-level/agda-packages.nix`. Here it is called in a scope with access to all other Agda libraries, so the derivation could look like:···-Note that the derivation function is called with `mkDerivation` set to `agdaPackages.mkDerivation`, therefore you-could use a similar set as in your `default.nix` from [Writing Agda Packages](#writing-agda-packages) with-This library has a file called `.agda-lib`, and so we give an empty string to `libraryFile` as nothing precedes `.agda-lib` in the filename. This file contains `name: IAL-1.3`, and so we let `libraryName = "IAL-1.3"`. This library does not use an `Everything.agda` file and instead has a Makefile, so there is no need to set `everythingFile` and we set a custom `buildPhase`.+Note that the derivation function is called with `mkDerivation` set to `agdaPackages.mkDerivation`, therefore you+could use a similar set as in your `default.nix` from [Writing Agda Packages](#writing-agda-packages) withWhen writing an Agda package it is essential to make sure that no `.agda-lib` file gets added to the store as a single file (for example by using `writeText`). This causes Agda to think that the nix store is a Agda library and it will attempt to write to it whenever it typechecks something. See [https://github.com/agda/agda/issues/4613](https://github.com/agda/agda/issues/4613).···
+3
-9
pkgs/build-support/agda/default.nix
+3
-9
pkgs/build-support/agda/default.nix
·········
+2
-2
pkgs/build-support/agda/lib.nix
+2
-2
pkgs/build-support/agda/lib.nix
···-* interfaceFile pkgs.agda.version "./Everything.agda" == "_build/2.6.4.3/agda/./Everything.agdai"-* interfaceFile pkgs.agda.version "src/Everything.lagda.tex" == "_build/2.6.4.3/agda/src/Everything.agdai"+* interfaceFile pkgs.agda.version "src/Foo.lagda.tex" == "_build/AGDA_VERSION/agda/src/Foo.agdai"
+12
pkgs/development/haskell-modules/configuration-nix.nix
+12
pkgs/development/haskell-modules/configuration-nix.nix
···
+3
-14
pkgs/development/libraries/agda/1lab/default.nix
+3
-14
pkgs/development/libraries/agda/1lab/default.nix
······
-5
pkgs/development/libraries/agda/agda-categories/default.nix
-5
pkgs/development/libraries/agda/agda-categories/default.nix
···-find src -name '*.agda' | sed -e 's|^src/[/]*|import |' -e 's|/|.|g' -e 's/.agda//' -e '/import Everything/d' | LC_COLLATE='C' sort > Everything.agda
-7
pkgs/development/libraries/agda/agda-prelude/default.nix
-7
pkgs/development/libraries/agda/agda-prelude/default.nix
···
-7
pkgs/development/libraries/agda/agdarsec/default.nix
-7
pkgs/development/libraries/agda/agdarsec/default.nix
+3
-3
pkgs/development/libraries/agda/cubical-mini/default.nix
+3
-3
pkgs/development/libraries/agda/cubical-mini/default.nix
···
+4
-8
pkgs/development/libraries/agda/cubical/default.nix
+4
-8
pkgs/development/libraries/agda/cubical/default.nix
······
-4
pkgs/development/libraries/agda/functional-linear-algebra/default.nix
-4
pkgs/development/libraries/agda/functional-linear-algebra/default.nix
+4
-1
pkgs/development/libraries/agda/generics/default.nix
+4
-1
pkgs/development/libraries/agda/generics/default.nix
+3
-12
pkgs/development/libraries/agda/standard-library/default.nix
+3
-12
pkgs/development/libraries/agda/standard-library/default.nix
···
+1
-3
pkgs/top-level/agda-packages.nix
+1
-3
pkgs/top-level/agda-packages.nix
···