direnv: Init

This commit is contained in:
PapaTutuWawa committed 2022-04-26 17:14:40 +02:00
1 parent 4ccbed71a8
commit 5be8612163
4 files changed
+28 -1

No files matched your search

+19
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;
};
};
};
}
+7 -1
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