diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2022-02-13 18:24:45 +0100 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2022-02-13 18:24:45 +0100 |
| commit | 3ab5b9be665f1ad5892f3c234f4c767499479698 (patch) | |
| tree | e3244707a2badf6195113340a60b5e06abd93c61 /modules/coq.nix | |
| parent | 1aabbc1b0d4018a0a9ddb0a0b3d6e6bbefb74883 (diff) | |
correct option to set version
Diffstat (limited to 'modules/coq.nix')
| -rw-r--r-- | modules/coq.nix | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/modules/coq.nix b/modules/coq.nix index 995dc40..21d1b71 100644 --- a/modules/coq.nix +++ b/modules/coq.nix @@ -3,23 +3,33 @@ with lib; let cfg = config.coq; - coqBuildInputs = - (with cfg.coqPackages; [ coq ]) - ++ (cfg.packages cfg.coqPackages); + # coqBuildInputs = (with cfg.coqPackages; [ coq ]) + # ++ (cfg.packages cfg.coqPackages); + coqBuildInputs = [ cfg.coq ] + ++ (map (package: package.override { coq = cfg.coq; }) + (cfg.packages pkgs.coqPackages)); coqrc = pkgs.writeText "coqrc" cfg.rc; coqFlags = concatStringsSep " " ([ "-init-file ${coqrc}" ]); in { options.coq = { enable = mkEnableOption { name = "coq"; }; - coqPackages = mkOption { - type = types.lazyAttrsOf types.package; - default = pkgs.coqPackages; - defaultText = literalExample "pkgs.coqPackages"; + coq = mkOption { + type = types.package; + default = pkgs.coq; + defaultText = literalExample "pkgs.coq"; description = '' - The set of Coq packages from which to get Coq and its packages. - Use this option to set the version of Coq. + The package providing Coq. Use this option to set the version of 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 = _: [ ]; @@ -49,9 +59,9 @@ in { config = mkIf cfg.enable { buildInputs = coqBuildInputs; aliases = { - coqc = "${cfg.coqPackages.coq}/bin/coqc ${coqFlags} \\$@"; - coqide = "${cfg.coqPackages.coq}/bin/coqide ${coqFlags} \\$@"; - coqtop = "${cfg.coqPackages.coq}/bin/coqtop ${coqFlags} \\$@"; + coqc = "${cfg.coq}/bin/coqc ${coqFlags} \\$@"; + coqide = "${cfg.coq}/bin/coqide ${coqFlags} \\$@"; + coqtop = "${cfg.coq}/bin/coqtop ${coqFlags} \\$@"; }; }; } |
