-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
home-manager-module.nix
38 lines (35 loc) · 1.06 KB
/
home-manager-module.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
self:
{
lib,
pkgs,
config,
...
}:
{
options = {
programs.nix-index.symlinkToCacheHome = lib.mkOption {
type = lib.types.bool;
default = config.programs.nix-index.enable;
description = ''
Whether to symlink the prebuilt nix-index database to the default
location used by nix-index. Useful for tools like comma.
'';
};
programs.nix-index-database.comma.enable = lib.mkEnableOption "wrapping comma with nix-index-database and put it in the PATH";
};
config = {
programs.nix-index = {
enable = lib.mkDefault true;
package = lib.mkDefault self.packages.${pkgs.stdenv.system}.nix-index-with-db;
};
home = {
packages =
lib.optional config.programs.nix-index-database.comma.enable
self.packages.${pkgs.stdenv.system}.comma-with-db;
file."${config.xdg.cacheHome}/nix-index/files" =
lib.mkIf config.programs.nix-index.symlinkToCacheHome
{ source = self.packages.${pkgs.stdenv.system}.nix-index-database; };
};
};
_file = ./darwin-module.nix;
}