2024-09-08 19:22:14 -05:00
|
|
|
{
|
2024-09-12 20:50:53 -05:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.custom.programs.direnv;
|
|
|
|
in {
|
|
|
|
options.custom.programs.direnv.enable = mkOption {default = false;};
|
2024-09-08 19:22:14 -05:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# https://github.com/direnv/direnv
|
2024-12-14 22:26:16 -06:00
|
|
|
programs.direnv =
|
|
|
|
{
|
2024-11-20 14:02:15 -06:00
|
|
|
enable = true;
|
2024-12-14 22:26:16 -06:00
|
|
|
loadInNixShell = false; # nix develop
|
|
|
|
}
|
|
|
|
// optionalAttrs (versionAtLeast version "24.11") {
|
2024-11-20 14:02:15 -06:00
|
|
|
silent = true;
|
|
|
|
};
|
2024-12-14 22:26:16 -06:00
|
|
|
|
|
|
|
home-manager.users.${config.custom.username} = {
|
|
|
|
programs.direnv =
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
}
|
|
|
|
// optionalAttrs (versionAtLeast version "24.11") {
|
|
|
|
silent = true;
|
|
|
|
};
|
2024-11-20 14:02:15 -06:00
|
|
|
};
|
2024-09-08 19:22:14 -05:00
|
|
|
};
|
|
|
|
}
|