home: move direnv around, disable direnv logging, add helper command

This commit is contained in:
Max Headroom 2023-08-22 15:35:40 +02:00
parent 89358eaa3c
commit 0b40ae50ca
2 changed files with 23 additions and 8 deletions

View file

@ -64,6 +64,7 @@ in
imports = [ imports = [
./home/bat.nix ./home/bat.nix
./home/editor ./home/editor
./home/direnv.nix
./home/fzf.nix ./home/fzf.nix
./home/lsd.nix ./home/lsd.nix
./home/git.nix ./home/git.nix
@ -71,14 +72,6 @@ in
./home/ssh.nix ./home/ssh.nix
] ++ optionalDesktopModule; ] ++ optionalDesktopModule;
# direnv
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
programs.direnv.enableFishIntegration = false;
programs.direnv.enableZshIntegration = true;
programs.direnv.config = {
global.warn_timeout = "24h";
};
programs.home-manager.enable = systemProfile == "headless"; programs.home-manager.enable = systemProfile == "headless";
programs.zsh.enable = true; programs.zsh.enable = true;
home.activation = lib.mkIf (systemProfile == "headless") { home.activation = lib.mkIf (systemProfile == "headless") {

22
users/max/home/direnv.nix Normal file
View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
let
use = pkgs.writeShellScriptBin "use" ''
echo "use ''${@:-flake}" >> .envrc
${pkgs.direnv}/bin/direnv allow
'';
in
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
enableFishIntegration = false;
enableZshIntegration = true;
config.global.warn_timeout = "24h";
};
home.sessionVariables.DIRENV_LOG_FORMAT = "";
home.packages = [ use ];
}