diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh index 07a9fed5..516b4979 100644 --- a/config/zsh/aliases.zsh +++ b/config/zsh/aliases.zsh @@ -6,22 +6,11 @@ alias -- -='cd -' alias q=exit alias clr=clear alias sudo='sudo ' - alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' - alias mkdir='mkdir -p' alias wget='wget -c' -if command -v exa >/dev/null; then - alias exa='exa --group-directories-first' - alias l='exa -1' - alias ll='exa -l' - alias la='LC_COLLATE=C exa -la' -else - alias l='ls -1' - alias ll='ls -l' -fi alias mk=make alias rcp='rsync -vaP --delete' @@ -31,21 +20,6 @@ alias gurl='curl --compressed' alias y='xclip -selection clipboard -in' alias p='xclip -selection clipboard -out' -alias sc=systemctl -alias ssc='sudo systemctl' - -alias nix-env='NIXPKGS_ALLOW_UNFREE=1 nix-env' -alias nen=nix-env -alias nch=nix-channel -alias ngc='nix-collect-garbage -d' -alias nre='sudo nixos-rebuild' -alias nup='sudo nix-channel --update && nre' - -if command -v nvim >/dev/null; then - alias vim=nvim - alias v=nvim -fi - autoload -U zmv take() { diff --git a/machines/default.nix b/machines/default.nix index 22e6e7a6..5224130b 100644 --- a/machines/default.nix +++ b/machines/default.nix @@ -34,6 +34,12 @@ extraGroups = [ "wheel" "video" "networkmanager" ]; shell = pkgs.zsh; }; + + alias.nix-env = "NIXPKGS_ALLOW_UNFREE=1 nix-env"; + alias.nen = "nix-env"; + alias.sc = "systemctl"; + alias.ssc = "sudo systemctl"; + alias.dots = "make -C ~/.dotfiles"; }; @@ -62,17 +68,4 @@ LESSHISTFILE = "$XDG_CACHE_HOME/lesshst"; WGETRC = "$XDG_CACHE_HOME/wgetrc"; }; - - # Prevents ~/.esd_auth files by disabling the esound protocol module for - # pulseaudio, which I likely don't need. Is there a better way? - hardware.pulseaudio.configFile = - let paConfigFile = - with pkgs; runCommand "disablePulseaudioEsoundModule" - { buildInputs = [ pulseaudio ]; } '' - mkdir "$out" - cp ${pulseaudio}/etc/pulse/default.pa "$out/default.pa" - sed -i -e 's|load-module module-esound-protocol-unix|# ...|' "$out/default.pa" - ''; - in lib.mkIf config.hardware.pulseaudio.enable - "${paConfigFile}/default.pa"; } diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 6c5fad19..a48befdd 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -15,6 +15,18 @@ sound.enable = true; hardware.pulseaudio.enable = true; + # Prevents ~/.esd_auth files by disabling the esound protocol module for + # pulseaudio, which I likely don't need. Is there a better way? + hardware.pulseaudio.configFile = + let paConfigFile = + with pkgs; runCommand "disablePulseaudioEsoundModule" + { buildInputs = [ pulseaudio ]; } '' + mkdir "$out" + cp ${pulseaudio}/etc/pulse/default.pa "$out/default.pa" + sed -i -e 's|load-module module-esound-protocol-unix|# ...|' "$out/default.pa" + ''; + in lib.mkIf config.hardware.pulseaudio.enable + "${paConfigFile}/default.pa"; services = { xserver.enable = true; diff --git a/modules/editors/vim.nix b/modules/editors/vim.nix index c38bbba0..656ea9cb 100644 --- a/modules/editors/vim.nix +++ b/modules/editors/vim.nix @@ -12,6 +12,8 @@ env.EDITOR = "nvim"; env.VIMINIT = "let \\$MYVIMRC='\\$XDG_CONFIG_HOME/nvim/init.vim' | source \\$MYVIMRC"; + alias.v = "nvim"; + # My vim config is too stateful to manage with nix init = '' if [ ! -d "$XDG_CONFIG_HOME/nvim" ]; then diff --git a/modules/shell/zsh.nix b/modules/shell/zsh.nix index 92978c37..b0edc8f7 100644 --- a/modules/shell/zsh.nix +++ b/modules/shell/zsh.nix @@ -24,6 +24,11 @@ source = ; recursive = true; }; + + alias.exa = "exa --group-directories-first"; + alias.l = "exa -1"; + alias.ll = "exa -l"; + alias.la = "LC_COLLATE=C exa -la"; }; programs.zsh = {