home: direnv: add 'postgres' library file
This commit is contained in:
parent
e3f021e832
commit
8ec992cbe3
2 changed files with 41 additions and 4 deletions
|
|
@ -7,11 +7,26 @@ in
|
|||
enable = mkDisableOption "direnv configuration";
|
||||
};
|
||||
|
||||
config.programs.direnv = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
nix-direnv = {
|
||||
# A better `use_nix`
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = {
|
||||
# A better `use_nix`
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
let
|
||||
libDir = ./lib;
|
||||
contents = builtins.readDir libDir;
|
||||
names = lib.attrNames contents;
|
||||
files = lib.filter (name: contents.${name} == "regular") names;
|
||||
linkLibFile = name:
|
||||
lib.nameValuePair
|
||||
"direnv/lib/${name}"
|
||||
{ source = libDir + "/${name}"; };
|
||||
in
|
||||
lib.my.genAttrs' files linkLibFile;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue