feat: add nix-direnv

This commit is contained in:
Rasyidan Akbar F. 2025-12-10 00:18:44 +07:00
commit 85785398b3
2 changed files with 30 additions and 0 deletions

View file

@ -8,6 +8,7 @@
./devtools/ai-tools.nix
./devtools/languages.nix
./devtools/default.nix
./devtools/direnv.nix
./devtools/try.nix
./secrets.nix
];
@ -34,6 +35,8 @@
path = "~/src/tries";
};
rsydn.direnv.enable = lib.mkDefault true;
rsydn.devTools = {
enable = lib.mkDefault true;
packages = with pkgs; [

View file

@ -0,0 +1,27 @@
{ config, lib, ... }:
let
inherit (lib) mkOption types mkIf;
cfg = config.rsydn.direnv;
in {
options.rsydn.direnv = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable direnv with nix-direnv for automatic devshell activation.";
};
silent = mkOption {
type = types.bool;
default = true;
description = "Suppress direnv loading messages.";
};
};
config = mkIf cfg.enable {
programs.direnv = {
enable = true;
enableNushellIntegration = true;
nix-direnv.enable = true;
silent = cfg.silent;
};
};
}