1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-15 17:51:01 +00:00
nix-darwin/modules/programs/nix-index/default.nix
2024-04-19 04:05:50 +02:00

33 lines
724 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.nix-index;
in
{
options = {
programs.nix-index.enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable nix-index and its command-not-found helper.";
};
programs.nix-index.package = mkOption {
type = types.package;
default = pkgs.nix-index;
defaultText = "pkgs.nix-index";
description = "This option specifies the nix-index package to use.";
};
};
config = mkIf config.programs.nix-index.enable {
environment.systemPackages = [ cfg.package ];
environment.interactiveShellInit = "source ${cfg.package}/etc/profile.d/command-not-found.sh";
};
}