diff --git a/bash_logout b/bash_logout deleted file mode 100644 index 9bccd62..0000000 --- a/bash_logout +++ /dev/null @@ -1,2 +0,0 @@ -clear -reset diff --git a/bash_profile b/bash_profile deleted file mode 100644 index c2a182e..0000000 --- a/bash_profile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/shell/shenv -source ~/.config/shell/commonenv -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/bashrc diff --git a/bashrc b/bashrc deleted file mode 100644 index b666d4d..0000000 --- a/bashrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/bashrc diff --git a/config/nix/hm/common.nix b/config/nix/hm/common.nix index 493eafe..b0ab15f 100644 --- a/config/nix/hm/common.nix +++ b/config/nix/hm/common.nix @@ -63,16 +63,80 @@ in # Fzf FZF_COMPLETION_OPTS = "${lib.strings.concatStringsSep " " config.programs.fzf.fileWidgetOptions}"; }; + treatsHomeAsJunk = [ + # Programs that think $HOME is a reasonable place to put their junk + # and don't allow the user to change those questionable choices + "adb" + "audacity" + "binwalk" # Should use .config according to the GitHub code though + "cabal" # TODO May have options but last time I tried it it crashed + "cmake" + "ddd" + "ghidra" + "itch" + "simplescreenrecorder" # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 + "vd" + "wpa_cli" + # TODO Maybe we can do something about node-gyp + ]; commonShellAliases = { + # Completion for existing commands + ls = "ls -h --color=auto"; + mkdir = "mkdir -v"; + # cp = "cp -i"; # Disabled because conflicts with the ZSH/Bash one. This separation is confusing I swear. + mv = "mv -iv"; + free = "free -h"; + df = "df -h"; + ffmpeg = "ffmpeg -hide_banner"; + ffprobe = "ffprobe -hide_banner"; + ffplay = "ffplay -hide_banner"; + # TODO Add ipython --no-confirm-exit --pdb + + # Frequent mistakes + sl = "ls"; + al = "la"; + mdkir = "mkdir"; + systemclt = "systemctl"; + please = "sudo"; + + # Shortcuts for commonly used commands + # ll = "ls -l"; # Disabled because would overwrite the colored one + # la = "ls -la"; # Eh maybe it's not that bad, but for now let's keep compatibility + s = "sudo -s -E"; + # n = "$HOME/.config/i3/terminal & disown"; # Not used anymore since alacritty daemon mode doesn't preserve environment variables + x = "startx ${config.xdg.configHome}/xinitrc; logout"; + nx = "nvidia-xrun ${config.xdg.configHome}/xinitrc; sudo systemctl start nvidia-xrun-pm; logout"; + # TODO Put in display.nix + # Was also thinking of not storing the config in .config and use nix-store instead, + # but maybe it's a bad idea as home-manager switch doesn't replace aliases in running shells + # FIXME Is it still relevant with NixOS? + + + # Give additional config to those programs, and not have them in my path + bower = "bower --config.storage.packages=${config.xdg.cacheHome}/bower/packages --config.storage.registry=${config.xdg.cacheHome}/bower/registry --config.storage.links=${config.xdg.cacheHome}/bower/links"; + gdb = "gdb -x ${config.xdg.configHome}/gdbinit"; + iftop = "iftop -c ${config.xdg.configHome}/iftoprc"; + lmms = "lmms --config ${config.xdg.configHome}/lmmsrc.xml"; + tmux = "tmux -f ${config.xdg.configHome}/tmux/tmux.conf"; + + # Preference + vi = "nvim"; + vim = "nvim"; + wol = "wakeonlan"; # TODO Really, isn't wol better? Also wtf Arch aliases to pass because neither is installed anyways x) + mutt = "neomutt"; + + # Bash/Zsh only cp = "cp -i --reflink=auto"; grep = "grep --color=auto"; dd = "dd status=progress"; rm = "rm -v --one-file-system"; - free = "free -m"; + # free = "free -m"; # Disabled because... no? Why? diff = "diff --color=auto"; dmesg = "dmesg --ctime"; wget = "wget --hsts-file ${config.xdg.cacheHome}/wget-hsts"; - }; + } // lib.attrsets.mergeAttrsList (map (p: {"${p}" = "HOME=${config.xdg.cacheHome}/junkhome ${p}";}) treatsHomeAsJunk); + # TODO Maybe make nixpkg wrapper instead? So it also works from dmenu + # Could also accept my fate... Home-manager doesn't necessarily make it easy to put things out of the home directory historySize = 100000; historyFile = "${config.xdg.cacheHome}/shell_history"; in @@ -193,7 +257,7 @@ in enableZshIntegration = true; enableSshSupport = true; pinentryFlavor = "gtk2"; # Falls back to curses when needed - sshKeys = ["72A5F2913026776593947CF00DFF330E820E731D"]; # TODO This seems to prevent other keys from being added? + sshKeys = [ "72A5F2913026776593947CF00DFF330E820E731D" ]; # TODO This seems to prevent other keys from being added? # FIXME For g extension, as base is not supposed to have private keys }; }; diff --git a/config/nix/hm/desktop.nix b/config/nix/hm/desktop.nix index cd56666..9a07883 100644 --- a/config/nix/hm/desktop.nix +++ b/config/nix/hm/desktop.nix @@ -448,7 +448,7 @@ { }; in { - ".xinitrc" = { + "${config.xdg.configHome}/xinitrc" = { # TODO Configurable source = pkgs.writeShellScript "xinitrc" '' ${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path} diff --git a/config/shell/.gitignore b/config/shell/.gitignore deleted file mode 100644 index 3cb575e..0000000 --- a/config/shell/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -extrc -*.zwc -.zcompdump diff --git a/config/shell/.zprofile b/config/shell/.zprofile deleted file mode 100644 index ff174ee..0000000 --- a/config/shell/.zprofile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shenv -source ~/.config/shell/commonenv diff --git a/config/shell/.zshrc b/config/shell/.zshrc deleted file mode 100644 index c6a82e6..0000000 --- a/config/shell/.zshrc +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env zsh - -source ~/.config/shell/shrc -source ~/.config/shell/commonrc -source ~/.config/shell/zshrc diff --git a/config/shell/shenv b/config/shell/shenv deleted file mode 100644 index 286e1a6..0000000 --- a/config/shell/shenv +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common environment variables and functions (BusyBox compatible) -# - -# And for the rest, see aliases -direnv JUNKHOME "$HOME/.cache/junkhome" diff --git a/config/shell/shrc b/config/shell/shrc deleted file mode 100644 index 1e7a9ab..0000000 --- a/config/shell/shrc +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env sh - -# -# Shell common aliases and customizations (BusyBox compatible) -# - -## COMMAND CONFIGURATION - -# Completion for existing commands -alias ls='ls -h --color=auto' -alias mkdir='mkdir -v' -alias cp="cp -i" -alias mv="mv -iv" -alias free='free -h' -alias df='df -h' - -alias ffmpeg='ffmpeg -hide_banner' -alias ffprobe='ffprobe -hide_banner' -alias ffplay='ffplay -hide_banner' - -# ALIASES - -# Frequent mistakes -alias sl=ls -alias al=la -alias mdkir=mkdir -alias systemclt=systemctl -alias please=sudo - -# Shortcuts for commonly used commands -alias ll="ls -l" -alias la="ls -la" -alias s='sudo -s -E' -alias n='$HOME/.config/i3/terminal & disown' -alias x='startx $HOME/.config/xinitrc; logout' -alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout' - -# For programs that think $HOME is a reasonable place to put their junk -# and don't allow the user to change those questionable choices -alias adb='HOME=$JUNKHOME adb' -alias audacity='HOME=$JUNKHOME audacity' -alias binwalk='HOME=$JUNKHOME binwalk' # Should use .config according to the GitHub code though -alias cabal='HOME=$JUNKHOME cabal' # TODO May have options but last time I tried it it crashed -alias cmake='HOME=$JUNKHOME cmake' -alias ddd='HOME=$JUNKHOME ddd' -alias ghidra='HOME=$JUNKHOME ghidra' -alias itch='HOME=$JUNKHOME itch' -alias simplescreenrecorder='HOME=$JUNKHOME simplescreenrecorder' # Easy fix https://github.com/MaartenBaert/ssr/blob/1556ae456e833992fb6d39d40f7c7d7c337a4160/src/Main.cpp#L252 -alias vd='HOME=$JUNKHOME vd' -alias wpa_cli='HOME=$JUNKHOME wpa_cli' -# TODO Maybe we can do something about node-gyp - -alias bower='bower --config.storage.packages=~/.cache/bower/packages --config.storage.registry=~/.cache/bower/registry --config.storage.links=~/.cache/bower/links' -alias gdb='gdb -x $HOME/.config/gdbinit' -alias iftop='iftop -c $HOME/.config/iftoprc' -alias lmms='lmms --config $HOME/.config/lmmsrc.xml' -alias tmux='tmux -f $HOME/.config/tmux/tmux.conf' - -# TODO ruby's gem when I find a use for it - -# FUNCTIONS -trysource() { - if [ -f "$1" ] - then - . "$1" - else - return 1 - fi -} - -_i_prefer() { # executables... - for candidate in "$@" - do - if [ -x "$(command -v "$candidate")" ] - then - choice="$candidate" - break - fi - done - if [ -z "$choice" ] - then - return - fi - for candidate in "$@" - do - if [ "$candidate" != "$choice" ] - then - alias "$candidate"="$choice" - fi - done -} -_i_prefer nvim vim vi -_i_prefer gopass pass -_i_prefer wakeonlan wol -_i_prefer neomutt mutt -unset _i_prefer - -## COLORS - -# trysource ~/.local/bin/colorSchemeApply -# Needed because xterm/urxvt won't use the last color, needed for vim - -## EXTENSIONS -trysource ~/.config/shell/extrc diff --git a/profile b/profile deleted file mode 100644 index 664271f..0000000 --- a/profile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -. ~/.config/shell/shenv -. ~/.config/shell/shrc diff --git a/zshenv b/zshenv deleted file mode 100644 index f78ec50..0000000 --- a/zshenv +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env zsh - -ZDOTDIR=~/.config/shell