mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-06 16:57:08 +00:00
34 lines
725 B
Nix
34 lines
725 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 it's 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";
|
||
|
|
||
|
};
|
||
|
}
|