blob: 89d0535b0273d3dd97c53c63b4d3c195bb0cde81 (
plain) (
tree)
|
|
{ config, lib, pkgs, ... }:
let
cfg = config.my.home.direnv;
fishEnabled = config.my.home.fish.enable;
in {
options.my.home.direnv = with lib; {
enable = mkEnableOption "direnv configuration";
};
config = lib.mkIf cfg.enable {
programs.direnv = {
enable = true;
nix-direnv = {
enable = true;
enableFlakes = true;
};
};
programs.fish.interactiveShellInit = lib.mkIf fishEnabled (
# Using mkAfter to make it more likely to appear after other
# manipulations of the prompt.
lib.mkAfter ''
${pkgs.direnv}/bin/direnv hook fish | source
'');
home.sessionVariables = { DIRENV_DEFAULT_FLAKE = "nixpkgs"; };
};
}
|