fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Mario Rodastreewide: remove marsam as maintainer (#4136)a4817894

master
1.3 KiB62 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.opam;
8
9in {
10  meta.maintainers = [ ];
11
12  options.programs.opam = {
13    enable = mkEnableOption "Opam";
14
15    package = mkOption {
16      type = types.package;
17      default = pkgs.opam;
18      defaultText = literalExpression "pkgs.opam";
19      description = "Opam package to install.";
20    };
21
22    enableBashIntegration = mkOption {
23      default = true;
24      type = types.bool;
25      description = ''
26        Whether to enable Bash integration.
27      '';
28    };
29
30    enableZshIntegration = mkOption {
31      default = true;
32      type = types.bool;
33      description = ''
34        Whether to enable Zsh integration.
35      '';
36    };
37
38    enableFishIntegration = mkOption {
39      default = true;
40      type = types.bool;
41      description = ''
42        Whether to enable Fish integration.
43      '';
44    };
45  };
46
47  config = mkIf cfg.enable {
48    home.packages = [ cfg.package ];
49
50    programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
51      eval "$(${cfg.package}/bin/opam env --shell=bash)"
52    '';
53
54    programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
55      eval "$(${cfg.package}/bin/opam env --shell=zsh)"
56    '';
57
58    programs.fish.shellInit = mkIf cfg.enableFishIntegration ''
59      eval (${cfg.package}/bin/opam env --shell=fish)
60    '';
61  };
62}