From 7463817aa78b7183ba065b8349538d7838e02a5c Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sat, 7 Apr 2018 20:27:44 +0200 Subject: [PATCH] nixify bash --- bash/.bashrc | 34 ---------------------------------- install.sh | 2 +- nix/.config/nixpkgs/home.nix | 9 +++++++++ 3 files changed, 10 insertions(+), 35 deletions(-) delete mode 100644 bash/.bashrc diff --git a/bash/.bashrc b/bash/.bashrc deleted file mode 100644 index d9754e3..0000000 --- a/bash/.bashrc +++ /dev/null @@ -1,34 +0,0 @@ - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=100000 -HISTFILESIZE=200000 - -alias nr="nix repl ''" -alias ns="nix-shell" -alias nsp="nix-shell -p" -alias niA="nix-env -iA nixos." -alias subl="sublime3" - -# eval $(thefuck --alias) - - function fuck () { - TF_PYTHONIOENCODING=$PYTHONIOENCODING; - export TF_ALIAS=fuck; - export TF_SHELL_ALIASES=$(alias); - export TF_HISTORY=$(fc -ln -10); - export PYTHONIOENCODING=utf-8; - TF_CMD=$( - thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@ - ) && eval $TF_CMD; - unset TF_HISTORY; - export PYTHONIOENCODING=$TF_PYTHONIOENCODING; - history -s $TF_CMD; - } - diff --git a/install.sh b/install.sh index c99b178..2b21d06 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash #!nix-shell -i bash -p stow set -e -$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gtk gpg mutt bash stow rofi +$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gtk gpg mutt stow rofi nix build -f. $(hostname -s) diff --git a/nix/.config/nixpkgs/home.nix b/nix/.config/nixpkgs/home.nix index 4d6f399..fc6b4d5 100644 --- a/nix/.config/nixpkgs/home.nix +++ b/nix/.config/nixpkgs/home.nix @@ -44,6 +44,15 @@ phassa = { hostname = "karpenoktem.nl"; port = 33933; }; }; }; + bash = { + enable = true; + historyControl = [ "erasedups" "ignoredups" "ignorespace" ]; + shellAliases = { + nr = "nix repl \"\""; + nsp = "nix-shell -p"; + }; + initExtra = "eval $(thefuck --alias)"; + }; }; xdg.configFile."streamlink/config".text = '' player = mpv --cache 2048