diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2021-12-03 11:48:19 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2021-12-03 11:48:19 +0100 |
| commit | 6bb027dbeb3dedb6c65cb27274465105bccdfb18 (patch) | |
| tree | 7613a6397d866617c5c71cb3c906d86f03baba75 /modules/coq.nix | |
initial commit
Diffstat (limited to 'modules/coq.nix')
| -rw-r--r-- | modules/coq.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/coq.nix b/modules/coq.nix new file mode 100644 index 0000000..3a1dfef --- /dev/null +++ b/modules/coq.nix @@ -0,0 +1,35 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.coq; + coqBuildInputs = (with cfg.coqPackages; [ coq ]) + ++ (cfg.packages cfg.coqPackages); +in { + options.coq = { + enable = mkEnableOption { name = "coq"; }; + coqPackages = mkOption { + type = types.lazyAttrsOf types.package; + default = pkgs.coqPackages; + defaultText = literalExample "pkgs.coqPackages"; + description = '' + The set of Coq packages from which to get Coq and its packages. + Use this option to set the version of Coq. + ''; + }; + packages = mkOption { + type = with types; functionTo (listOf package); + default = _: [ ]; + defaultText = literalExample "_: [ ]"; + description = '' + Coq packages that will be made available to the environment. + ''; + example = literalExample '' + coqPackages: with coqPackages; [ autosubst ]; + ''; + }; + }; + config = mkIf cfg.enable { + buildInputs = coqBuildInputs; + }; +} |
