Browse Source

nixify bash

master
Yorick van Pelt 1 year ago
parent
commit
7463817aa7
3 changed files with 10 additions and 35 deletions
  1. 0
    34
      bash/.bashrc
  2. 1
    1
      install.sh
  3. 9
    0
      nix/.config/nixpkgs/home.nix

+ 0
- 34
bash/.bashrc View File

@@ -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 '<nixpkgs>'"
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;
}

+ 1
- 1
install.sh View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
#!nix-shell -i bash -p stow
set -e
$(nix-build '<nixpkgs>' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gtk gpg mutt bash stow rofi
$(nix-build '<nixpkgs>' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gtk gpg mutt stow rofi
nix build -f. $(hostname -s)

+ 9
- 0
nix/.config/nixpkgs/home.nix View File

@@ -44,6 +44,15 @@
phassa = { hostname = "karpenoktem.nl"; port = 33933; };
};
};
bash = {
enable = true;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
shellAliases = {
nr = "nix repl \"<nixpkgs>\"";
nsp = "nix-shell -p";
};
initExtra = "eval $(thefuck --alias)";
};
};
xdg.configFile."streamlink/config".text = ''
player = mpv --cache 2048

Loading…
Cancel
Save