2017-10-18 00:12:57 +00:00
|
|
|
{
|
|
|
|
|
2023-08-13 19:34:14 +00:00
|
|
|
pkgs ? (import ../pkgs.nix).stable {},
|
|
|
|
config,
|
2017-10-18 00:12:57 +00:00
|
|
|
|
|
|
|
}: rec {
|
|
|
|
|
|
|
|
ohMyZsh = ./oh-my-zsh;
|
|
|
|
|
2023-08-13 19:34:14 +00:00
|
|
|
bin = pkgs.buildEnv {
|
|
|
|
name = "mediocregopher-bin";
|
|
|
|
paths = [
|
|
|
|
(pkgs.stdenv.mkDerivation {
|
|
|
|
name = "mediocregopher-default-bin";
|
|
|
|
src = ../bin;
|
|
|
|
builder = builtins.toFile "builder.sh" ''
|
|
|
|
source $stdenv/setup
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -rL "$src" "$out"/bin
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
] ++ (
|
|
|
|
builtins.map (cFn: cFn pkgs) config.binExtra
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2017-10-18 00:12:57 +00:00
|
|
|
zshrc = pkgs.writeTextDir ".zshrc" ''
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2023-08-13 19:34:14 +00:00
|
|
|
export PATH=${bin}/bin:$PATH
|
|
|
|
|
|
|
|
#Global stuff shitty programs use
|
|
|
|
export EDITOR=~/.nix-profile/bin/nvim
|
|
|
|
|
|
|
|
# GPG is needy
|
|
|
|
export GPG_TTY=$(tty)
|
2017-10-18 00:12:57 +00:00
|
|
|
|
|
|
|
. ${./zshrc}
|
|
|
|
. ${./aliases}
|
|
|
|
. ${pkgs.nix}/etc/profile.d/nix.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
zsh = pkgs.writeScriptBin "zsh" ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
ZDOTDIR=${zshrc} exec ${pkgs.zsh}/bin/zsh "$@"
|
|
|
|
'';
|
|
|
|
}
|