diff --git a/nix/home.nix b/nix/home.nix index f517556..59792b9 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -16,6 +16,24 @@ with lib; zsh-syntax-highlighting ]; + programs.direnv = { + enable = true; + stdlib = '' + layout_postgres() { + export PGDATA="$(direnv_layout_dir)/tmp/pgdata" + export PGHOST="$PGDATA" + if [[ ! -d "$PGDATA" ]]; then + initdb --locale=$LANG + cat <<'EOF' >>"$PGDATA/postgresql.conf" + listen_addresses = 'localhost' + unix_socket_directories = '$PGHOST' + EOF + echo "CREATE DATABASE $USER;" | postgres --single -E postgres + fi + } + ''; + }; + programs.command-not-found.enable = true; programs.git = { @@ -25,6 +43,7 @@ with lib; ignores = [ ".idea/" ".direnv/" + ".envrc" ".tools-info" "*~" "*.swp" @@ -37,6 +56,7 @@ with lib; defaultKeymap = "viins"; initExtra = mkForce ('' + export LOCALE_ARCHIVE="/usr/lib/locale/locale-archive" export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH export EDITOR=vim