summaryrefslogtreecommitdiff
path: root/dotfiles/.bashrc
blob: 06f8579ece6fcd5b03586f689923263403cadf33 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- shell-script -*-
# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").

# Export 'SHELL' to child processes.  Programs such as 'screen'
# honor it and otherwise use /bin/sh.
export SHELL

if [ -n "$SSH_CLIENT" -a -z "`type -P cat`" ]
then
    # We are being invoked from a non-interactive SSH session
    # (as in "ssh host command") but 'cat' cannot be found
    # in $PATH.  Source /etc/profile so we get $PATH and other
    # essential variables.
    source /etc/profile
fi

# Append to the history file, don't overwrite it
shopt -s histappend

# For setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# Don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth

# Check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# The pattern "**" used in a pathname expansion context will match all
# files and zero or more directories and subdirectories.
shopt -s globstar

# Add special decoration when we are in a Guix environment sub-shell.
if [ -n "$GUIX_ENVIRONMENT" ]
then
    export PS1="\u@\h \w [env]\$ "
else
    export PS1='\u@\h \w\$ '
fi

# Add special decoration when we are in an Okta AWS sub-shell.
if [ -n "$OKTA_AWS_ROLE" ]
then
    export PS1="\u@\h \w [$OKTA_AWS_ROLE]\$ "
else
    export PS1='\u@\h \w\$ '
fi

alias ls='ls -p --color'
alias ll='ls -l'

alias guix-dev-env="cd ~/Code/guix; guix environment -e '(@@ (gnu packages package-management) guix-devel)'"
alias sly-dev-env="cd ~/Code/sly; guix environment -l package.scm"

if vhl
then
    alias chef-env="cd ~/Code/chef-repo; eval $(~/bin/gem-env chef-repo)"
    alias api-env="cd ~/Code/api; eval $(~/bin/gem-env api)"
    alias knife="bundle exec knife"
    alias berks="bundle exec berks"
    alias kitchen="bundle exec kitchen"
    alias cfer="bundle exec cfer"
fi