summaryrefslogtreecommitdiff
path: root/zsh/default.nix
blob: 4015ce6836de9df3d0261b27aca55d9f20848e0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{

  pkgs ? (import ../pkgs.nix).stable {},
  config,

}: rec {

  zshrc = pkgs.writeTextDir ".zshrc" ''
    # Import before anything else, so that we have the full PATH available for
    # everything following
    . ${pkgs.nix}/etc/profile.d/nix.sh

    # oh-my-zsh
    export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh
    ZSH_CUSTOM=${./custom}
    ZSH_THEME=mediocregopher
    DISABLE_AUTO_UPDATE=true
    plugins=(git vi-mode)
    source $ZSH/oh-my-zsh.sh

    export BROWSER=${config.browser}

    . ${./zshrc}
    . ${./aliases}
  '';

  zsh = pkgs.writeScriptBin "zsh" ''
    #!${pkgs.bash}/bin/bash
    ZDOTDIR=${zshrc} exec ${pkgs.zsh}/bin/zsh "$@"
  '';
}