direnv: Init

This commit is contained in:
PapaTutuWawa 2022-04-23 20:12:59 +02:00
parent 4ccbed71a8
commit 5be8612163
4 changed files with 28 additions and 1 deletions

View File

@ -68,6 +68,7 @@
};
#xournalpp.enable = true;
zsh.enable = true;
direnv.enable = true;
office.enable = true;
plasma.enable = true;
gaming.enable = true;

View File

@ -24,6 +24,7 @@
./programs/office
./programs/gaming
./programs/bluray
./programs/direnv
# Services
./services/kanshi

View File

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.direnv;
in {
options.ptw.programs.direnv = {
enable = lib.mkEnableOption "Enable direnv";
};
config = lib.mkIf cfg.enable {
home-manager.users."${config.ptw.system.singleUser}".programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv = {
enable = true;
};
};
};
}

View File

@ -47,8 +47,14 @@ in {
bindkey "\e[3~" delete-char
'';
history.share = true;
initExtraFirst = let
enableDirenv = lib.optionalString
config.ptw.programs.direnv.enable
"eval \"$(${pkgs.direnv}/bin/direnv hook zsh)\"";
in ''
${enableDirenv}
# TODO: Maybe move this somewhere else
initExtraFirst = ''
wcurl() {
[[ -z "$1" ]] && echo "Error: No URL specified" && exit 1