mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-15 17:51:01 +00:00
add programs.nix-index module
This commit is contained in:
parent
cfc0e3465f
commit
45d259cb3e
2 changed files with 34 additions and 0 deletions
|
@ -52,6 +52,7 @@ let
|
||||||
./modules/programs/fish.nix
|
./modules/programs/fish.nix
|
||||||
./modules/programs/man.nix
|
./modules/programs/man.nix
|
||||||
./modules/programs/info
|
./modules/programs/info
|
||||||
|
./modules/programs/nix-index
|
||||||
./modules/programs/nix-script.nix
|
./modules/programs/nix-script.nix
|
||||||
./modules/programs/tmux.nix
|
./modules/programs/tmux.nix
|
||||||
./modules/programs/vim.nix
|
./modules/programs/vim.nix
|
||||||
|
|
33
modules/programs/nix-index/default.nix
Normal file
33
modules/programs/nix-index/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ 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";
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue