diff --git a/dotfiles/env b/dotfiles/env index 28820da6..86060ce0 100644 --- a/dotfiles/env +++ b/dotfiles/env @@ -3,9 +3,8 @@ # Set emacsclient as a "browser" - xdg-open naively checks this # variable to open unknown file types, or otherwise tries to open -# absolutely everything in firefox. Really need to find out who wrote -# that script and slap them. -export BROWSER="emacsclient --no-wait -c" +# absolutely everything in firefox. +export BROWSER="firefox" export XDG_CONFIG_HOME="$HOME/.config" export XDG_DATA_HOME="$HOME/.local/share" diff --git a/dotfiles/zshrc b/dotfiles/zsh/.zshrc similarity index 61% rename from dotfiles/zshrc rename to dotfiles/zsh/.zshrc index f47f72ac..be389c2e 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zsh/.zshrc @@ -7,10 +7,36 @@ export "NIX_PATH=${NIX_PATH:-$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH}" # Don't create .zcompdump files in $HOME -autoload -Uz compinit && compinit -d "${XDG_CACHE_HOME}/zsh/zcompdump-${ZSH_VERSION}" +autoload -Uz compaudit compinit && compinit -d "${XDG_CACHE_HOME}/zsh/zcompdump-${ZSH_VERSION}" # Everything else is just for interactive shells if [[ -o interactive ]]; then + # Load other extensions + autoload -U zcalc + + # Allow nix-shell to function + if (( $+commands[any-nix-shell] )); then + any-nix-shell zsh | source /dev/stdin + fi + + # Activate direnv + eval "$(direnv hook zsh)" + + # Load more granular configuration files + source "$ZDOTDIR/functions.zsh" + source "$ZDOTDIR/aliases.zsh" + source "$ZDOTDIR/completion.zsh" + source "$ZDOTDIR/keybindings.zsh" + source "$ZDOTDIR/theme.zsh" + source "$ZDOTDIR/oh-my-zsh-expat/oh-my-zsh-expat.zsh" + + # Load plugins + for plugin in "$ZDOTDIR/plugins/"*; do + for file in "$plugin/"*.zsh; do + source "$file" + done + done + # Start screen if... if \ # The command exists \ @@ -24,8 +50,4 @@ if [[ -o interactive ]]; then [ "$TERM" != "linux" ]; then exec screen -AxRR -c "$XDG_CONFIG_HOME/screen/config" fi - - # Load zsh configuration - ZDOTDIR="$XDG_CONFIG_HOME/zsh" - source "$ZDOTDIR/zshrc" fi diff --git a/dotfiles/zsh/oh-my-zsh-expat/oh-my-zsh-expat.zsh b/dotfiles/zsh/oh-my-zsh-expat/oh-my-zsh-expat.zsh index 30bd977c..13672d26 100644 --- a/dotfiles/zsh/oh-my-zsh-expat/oh-my-zsh-expat.zsh +++ b/dotfiles/zsh/oh-my-zsh-expat/oh-my-zsh-expat.zsh @@ -14,8 +14,6 @@ for plugin in "$ZSH/plugins/"*; do fpath=($plugin $fpath) done -autoload -U compaudit compinit - for plugin in "$ZSH/plugins/"*; do source "$plugin/$(basename $plugin).plugin.zsh" done diff --git a/dotfiles/zsh/zshrc b/dotfiles/zsh/zshrc deleted file mode 100644 index 055acbcf..00000000 --- a/dotfiles/zsh/zshrc +++ /dev/null @@ -1,28 +0,0 @@ -# Ensure we follow XDG_BASE_DIRECTORY specifications -HISTFILE="$XDG_DATA_HOME/.zsh_history" - -# Load extensions -autoload -U zcalc - -# Allow nix-shell to function -if (( $+commands[any-nix-shell] )); then - any-nix-shell zsh | source /dev/stdin -fi - -# Activate direnv -eval "$(direnv hook zsh)" - -# Load more granular configuration files -source "$ZDOTDIR/functions.zsh" -source "$ZDOTDIR/aliases.zsh" -source "$ZDOTDIR/completion.zsh" -source "$ZDOTDIR/keybindings.zsh" -source "$ZDOTDIR/theme.zsh" -source "$ZDOTDIR/oh-my-zsh-expat/oh-my-zsh-expat.zsh" - -# Load plugins -for plugin in "$ZDOTDIR/plugins/"*; do - for file in "$plugin/"*.zsh; do - source "$file" - done -done diff --git a/dotfiles/zshenv b/dotfiles/zshenv new file mode 100644 index 00000000..884c68af --- /dev/null +++ b/dotfiles/zshenv @@ -0,0 +1,3 @@ +setopt no_global_rcs +HISTFILE="$XDG_DATA_HOME/.zsh_history" +ZDOTDIR="$XDG_CONFIG_HOME/zsh" diff --git a/nixpkgs/configurations/tty-programs/mail/default.nix b/nixpkgs/configurations/tty-programs/mail/default.nix index c1e97a4f..762575e0 100644 --- a/nixpkgs/configurations/tty-programs/mail/default.nix +++ b/nixpkgs/configurations/tty-programs/mail/default.nix @@ -16,7 +16,7 @@ in { local.dump-ics ]; - home.file.".mailcap".source = "${dotroot}/dotfiles/mailcap"; + xdg.configFile."mailcap".source = "${dotroot}/dotfiles/mailcap"; programs = { mbsync.enable = true; diff --git a/nixpkgs/configurations/tty-programs/pcs.nix b/nixpkgs/configurations/tty-programs/pcs.nix index 6d1e6e03..0d5dab67 100644 --- a/nixpkgs/configurations/tty-programs/pcs.nix +++ b/nixpkgs/configurations/tty-programs/pcs.nix @@ -12,7 +12,10 @@ ncmpcpp = { enable = true; - settings.ncmpcpp_directory = "${config.xdg.dataHome}"; + settings = { + ncmpcpp_directory = "${config.xdg.dataHome}/ncmpcpp"; + lyrics_directory = "${config.xdg.dataHome}/lyrics"; + }; }; password-store = { diff --git a/nixpkgs/configurations/tty-programs/zsh.nix b/nixpkgs/configurations/tty-programs/zsh.nix index 2e6f2101..02e2adf4 100644 --- a/nixpkgs/configurations/tty-programs/zsh.nix +++ b/nixpkgs/configurations/tty-programs/zsh.nix @@ -4,12 +4,10 @@ home.packages = with pkgs; [ zsh ]; # Basic, local config - home.file.".zshrc".source = "${dotroot}/dotfiles/zshrc"; - xdg.configFile = { - "zsh" = { - recursive = true; - source = "${dotroot}/dotfiles/zsh"; - }; + home.file.".zshenv".source = "${dotroot}/dotfiles/zshenv"; + xdg.configFile."zsh" = { + recursive = true; + source = "${dotroot}/dotfiles/zsh"; }; # Plugins diff --git a/nixpkgs/configurations/xdg-settings.nix b/nixpkgs/configurations/xdg-settings.nix index 5b1b7dcc..eb13a72a 100644 --- a/nixpkgs/configurations/xdg-settings.nix +++ b/nixpkgs/configurations/xdg-settings.nix @@ -29,7 +29,14 @@ in { CARGO_HOME = "${xdg.cacheHome}/cargo"; RUSTUP_HOME = "${xdg.dataHome}/rustup"; XCOMPOSECACHE = "${xdg.cacheHome}/X11/xcompose"; + XCOMPOSEFILE = "${xdg.configHome}X11/xcompose"; NPM_CONFIG_USERCONFIG = "${xdg.configHome}/npm/npmrc"; + MAILCAPS = "${xdg.configHome}/mailcap"; + PYTHONSTARTUP = "${xdg.configHome}/python/startup.py"; + IPYTHONDIR = "${xdg.dataHome}/ipython"; + JUPYTER_CONFIG_DIR = "${xdg.dataHome}/ipython"; + HISTFILE = "${xdg.dataHome}/histfile"; + RLWRAP_HOME = "${xdg.dataHome}/rlwrap"; # stumpish and perhaps others # See, this is exactly why things should follow the spec. I have # no intention of using gradle ever, but occasionally I need to @@ -50,4 +57,12 @@ in { cache=${xdg.cacheHome}/npm tmp=$XDG_RUNTIME_DIR/npm ''; + + # Aaand python is configured using a python script. Wonderful. + xdg.configFile."python/startup.py" = { + text = '' + import readline + readline.set_auto_history(False) + ''; + }; }