24 lines
		
	
	
	
		
			400 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			400 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| {
 | |
|   config,
 | |
|   lib,
 | |
|   namespace,
 | |
|   options,
 | |
|   ...
 | |
| }:
 | |
| let
 | |
|   inherit (lib) mkIf;
 | |
|   inherit (lib.${namespace}) mkBoolOpt enabled;
 | |
|   cfg = config.${namespace}.tools.direnv;
 | |
| in
 | |
| {
 | |
|   options.${namespace}.tools.direnv = {
 | |
|     enable = mkBoolOpt false "Whether or not to enable direnv.";
 | |
|   };
 | |
| 
 | |
|   config = mkIf cfg.enable {
 | |
|     programs.direnv = {
 | |
|       enable = true;
 | |
|       nix-direnv = enabled;
 | |
|     };
 | |
|   };
 | |
| }
 |