Compare commits
6
Commits
34205bf384
...
3c97d0a21f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c97d0a21f | ||
|
|
349d697391 | ||
|
|
86e780da0d | ||
|
|
31e2bae402 | ||
|
|
4f77043e3b | ||
|
|
db31984573 |
+1
-34
@@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
|
|
||||||
# Editor & prompt configuration
|
# Prompt configuration
|
||||||
[ -f "$HOME/.bashrc.d/editor" ] && . "$HOME/.bashrc.d/editor"
|
|
||||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
||||||
|
|
||||||
# Aliases {{{
|
# Aliases {{{
|
||||||
@@ -31,24 +30,6 @@ done
|
|||||||
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
[ -f "$HOME/.bashrc.d/prompt" ] && . "$HOME/.bashrc.d/prompt"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Path {{{
|
|
||||||
# Add ~/.bin to PATH
|
|
||||||
export PATH=~/.bin:$PATH
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# History {{{
|
|
||||||
export HISTSIZE=999999
|
|
||||||
export HISTFILESIZE= # Unlimited
|
|
||||||
export HISTCONTROL=ignoreboth:erasedups
|
|
||||||
export HISTIGNORE=" *:clear:l:ls:cd" # Omit commands from history (e.g. those prepended with space)
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# Man pages {{{
|
|
||||||
# See `:h :Man` in NeoVim
|
|
||||||
export MANWIDTH=80
|
|
||||||
export PAGER=nvimpager
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# X11 {{{
|
# X11 {{{
|
||||||
export XDG_SESSION_TYPE=X11
|
export XDG_SESSION_TYPE=X11
|
||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
@@ -58,16 +39,6 @@ export XDG_DATA_HOME=$HOME/.local/share
|
|||||||
# FZF {{{
|
# FZF {{{
|
||||||
# Check if fzf is installed
|
# Check if fzf is installed
|
||||||
if [ -f "/usr/bin/fzf" ]; then
|
if [ -f "/usr/bin/fzf" ]; then
|
||||||
# Fuzzy finder setup
|
|
||||||
export FZF_COMPLETION_TRIGGER='**'
|
|
||||||
export FZF_DEFAULT_COMMAND='rg --files ""'
|
|
||||||
export FZF_DEFAULT_OPTS="
|
|
||||||
--pointer='❭'
|
|
||||||
--height 10%
|
|
||||||
--color=fg:-1,bg:-1"
|
|
||||||
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
|
|
||||||
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
|
|
||||||
|
|
||||||
if [[ $ID == "raspbian" ]]; then
|
if [[ $ID == "raspbian" ]]; then
|
||||||
. /usr/share/doc/fzf/examples/completion.bash
|
. /usr/share/doc/fzf/examples/completion.bash
|
||||||
. /usr/share/doc/fzf/examples/key-bindings.bash
|
. /usr/share/doc/fzf/examples/key-bindings.bash
|
||||||
@@ -82,10 +53,6 @@ else
|
|||||||
fi
|
fi
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Go {{{
|
|
||||||
export GOPATH="${XDG_DATA_HOME}/go"
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# Jupyter {{{
|
# Jupyter {{{
|
||||||
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
|
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
# shellcheck shell=bash
|
|
||||||
# vim: set ft=bash :
|
|
||||||
|
|
||||||
# Set NeoVim as default editor
|
|
||||||
export EDITOR=nvim
|
|
||||||
export SUDO_EDITOR="$EDITOR"
|
|
||||||
export SYSTEMD_EDITOR="$EDITOR"
|
|
||||||
@@ -5,18 +5,18 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.go;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.go = {
|
options.go = {
|
||||||
enable = lib.mkEnableOption "Go";
|
enable = lib.mkEnableOption "Go";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf config.go.enable {
|
||||||
home.packages = with pkgs; [
|
home = {
|
||||||
|
sessionVariables.GOPATH = "${config.xdg.dataHome}/go";
|
||||||
|
packages = with pkgs; [
|
||||||
go
|
go
|
||||||
gopls
|
gopls
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,15 +6,23 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.nvim;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.nvim.enable = lib.mkEnableOption "nvim";
|
options.nvim.enable = lib.mkEnableOption "nvim";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf config.nvim.enable {
|
||||||
home.packages = [
|
home = {
|
||||||
|
sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
SUDO_EDITOR = "nvim";
|
||||||
|
SYSTEMD_EDITOR = "nvim";
|
||||||
|
|
||||||
|
PAGER = "nvimpager";
|
||||||
|
MANWIDTH = "80";
|
||||||
|
};
|
||||||
|
packages = with pkgs; [
|
||||||
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
|
inputs.nvim.packages.${pkgs.stdenv.hostPlatform.system}.nvim
|
||||||
|
nvimpager
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,22 @@ in
|
|||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|
||||||
|
historySize = 999999;
|
||||||
|
historyFileSize = -1; # unlimited
|
||||||
|
historyControl = [
|
||||||
|
"ignoreboth"
|
||||||
|
"erasedups"
|
||||||
|
];
|
||||||
|
# omit commands from history (e.g. those prepended with space)
|
||||||
|
historyIgnore = [
|
||||||
|
" *"
|
||||||
|
"clear"
|
||||||
|
"l"
|
||||||
|
"ls"
|
||||||
|
"cd"
|
||||||
|
];
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
for f in /home/${username}/.bashrc.d/*; do
|
for f in /home/${username}/.bashrc.d/*; do
|
||||||
[ -f "$f" ] && source "$f"
|
[ -f "$f" ] && source "$f"
|
||||||
@@ -45,8 +61,6 @@ in
|
|||||||
${lib.optionalString cfg.aliases.all "source /home/${username}/.bash_aliases/all"}
|
${lib.optionalString cfg.aliases.all "source /home/${username}/.bash_aliases/all"}
|
||||||
${lib.optionalString cfg.aliases.lang-js "source /home/${username}/.bash_aliases/lang-js"}
|
${lib.optionalString cfg.aliases.lang-js "source /home/${username}/.bash_aliases/lang-js"}
|
||||||
|
|
||||||
${lib.optionalString cfg.addBinToPath "export PATH=${dotsPath}/.bin:$PATH"}
|
|
||||||
|
|
||||||
${cfg.extraInit}
|
${cfg.extraInit}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@@ -54,7 +68,6 @@ in
|
|||||||
home.file = {
|
home.file = {
|
||||||
".inputrc".source = dotsPath + "/.inputrc";
|
".inputrc".source = dotsPath + "/.inputrc";
|
||||||
".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt";
|
".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt";
|
||||||
".bashrc.d/editor".source = dotsPath + "/.bashrc.d/editor";
|
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs cfg.aliases.all {
|
// lib.optionalAttrs cfg.aliases.all {
|
||||||
".bash_aliases/all".source = dotsPath + "/.bash_aliases/all";
|
".bash_aliases/all".source = dotsPath + "/.bash_aliases/all";
|
||||||
@@ -62,5 +75,6 @@ in
|
|||||||
// lib.optionalAttrs cfg.aliases.lang-js {
|
// lib.optionalAttrs cfg.aliases.lang-js {
|
||||||
".bash_aliases/lang-js".source = dotsPath + "/.bash_aliases/lang-js";
|
".bash_aliases/lang-js".source = dotsPath + "/.bash_aliases/lang-js";
|
||||||
};
|
};
|
||||||
|
home.sessionPath = lib.optional cfg.addBinToPath "${dotsPath}/.bin";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,15 @@
|
|||||||
programs.fzf = {
|
programs.fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableBashIntegration = lib.mkDefault true;
|
enableBashIntegration = lib.mkDefault true;
|
||||||
|
defaultCommand = "rg --files";
|
||||||
|
defaultOptions = [
|
||||||
|
"--pointer='❭'"
|
||||||
|
"--height 10%"
|
||||||
|
];
|
||||||
|
fileWidget = {
|
||||||
|
command = "rg --files";
|
||||||
|
options = [ "--preview 'bat {} | head -500'" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|||||||
Reference in New Issue
Block a user