summaryrefslogtreecommitdiff
path: root/modules/programs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-07-28 23:17:53 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-07-28 23:17:53 +0200
commit45d259cb3e000d5936462c19576ea11f0440fb50 (patch)
treeeb036713dfad0ba6be71c22f60dc3700647b6da2 /modules/programs
parentcfc0e3465fd26b48d24aeef83c11b07b4116fd20 (diff)
add programs.nix-index module
Diffstat (limited to 'modules/programs')
-rw-r--r--modules/programs/nix-index/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/programs/nix-index/default.nix b/modules/programs/nix-index/default.nix
new file mode 100644
index 0000000..8faa147
--- /dev/null
+++ b/modules/programs/nix-index/default.nix
@@ -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";
+
+ };
+}