X-Git-Url: https://git.kernelpanic.cafe/?p=MarigoldOS%2F.git;a=blobdiff_plain;f=profiles%2Falias.nix;fp=profiles%2Falias.nix;h=021d192f8045198f7adeb031b8999c86d5ef91ce;hp=0000000000000000000000000000000000000000;hb=60585824ee484171224848ea21fa2ae59eedac24;hpb=67ab519bdaf4d57595dc267cf023d7b2f76d5485 diff --git a/profiles/alias.nix b/profiles/alias.nix new file mode 100644 index 0000000..021d192 --- /dev/null +++ b/profiles/alias.nix @@ -0,0 +1,93 @@ +{ pkgs, lib, ... }: +{ + environment.shellAliases = { + # Aliases - For when you want to save keystrokes + + ## Better defaults + cp = "cp -i"; # Confirm before overwriting something + ln = "ln -i"; # Confirm before overwriting something + mv = "mv -i"; # Confirm before overwriting something + df = "df -h"; # Human-readable sizes + free = "free -m"; # Show sizes in MB + ls = "ls -h --color=auto"; # Human readable, Color + sudo = lib.mkDefault "sudo "; # ending in space allows next word to be aliased. + diff = "diff --color=auto"; + grep = "grep --color=auto"; + ip = "ip --color=auto"; + dir = "dir --color=auto"; + + md = "mkdir"; + # shit = "sudo !!"; + + lswifi = "nmcli device wifi list --rescan yes"; + + pip3s = "pip3 search"; + pip3i = "pip3 install"; + pms = "nix search"; # Package manager search. Was originally pacman search, but works equally we ll for this . + pmi = " nix-env -iA"; # Package manager install. Installs imperitively to user + pmiu = "nix-env -f channel:nixos-unstable -iA"; # Same as above but unstable channel + pmis = "nix-env -i"; # the s stands for... slow, sketchy, something + + sshfs = "sshfs -o auto_unmount -o reconnect"; + sshfsc = "sshfs -o auto_unmount -o reconnect -o auto_cache"; + + ## Shortcuts to Common Args + ### NixOS stuff + rebuild = "sudo nixos-rebuild test"; + rebuild-lock = "sudo nixos-rebuild switch"; + nsp = "nix-shell -p"; + # nix-index-update = "${pkgs.nix-index}/bin/nix-index"; + nt = "nix-top"; + + ## Full File search + ffs = "grep --line-buffered --color=never -r '' * | ${pkgs.fzf}/bin/fzf"; + + ### ls + la = "ls -Ah --color=auto"; # Show hidden files + ll = "ls -lh --color=auto"; # Show file size, modified date + lla = "ls -lAh --color=auto"; # Show everything + + ## Lighternet + # gopher = "${pkgs.ncgopher}/bin/ncgopher"; + # gemini = "${pkgs.amfora}/bin/amfora"; + + ### Taskwarrior + # twa = "${pkgs.taskwarrior}/bin/task add"; + # twm = "${pkgs.taskwarrior}/bin/task modify"; + + ### IPFS + #ipfs = "sudo -u ipfs ipfs"; + + nixed = "nano /etc/nixos/configuration.nix"; + cdnix = "cd /etc/nixos/"; + + aliased = "nano $HOME/.alias && source $HOME/.alias"; # Same but alias and functions + zshed = "nano $HOME/.zshrc && source $HOME/.zshrc"; # Edit zshrc then source it + + ## Moving Around + "cd.." = "cd .."; + "cd..." = "cd ../.."; + "cd...."= "cd ../../.."; + "cd....." = "cd ../../../.."; + "cd......" = "cd ../../../../.."; + + lsgrep = "ls -a | grep -i"; + hgrep = "history | grep -i"; + psgrep = "ps aux | grep -i"; + + wget = "${pkgs.wget}/bin/wget -c"; + chown = "chown --preserve-root"; + chmod = "chmod --preserve-root"; + chgrp = "chgrp --preserve-root"; + + # app shortcuts + # what = "${pkgs.goldendict}/bin/goldendict";# Instant lookup in dictionary or wikipedia + ydl = "${pkgs.yt-dlp}/bin/yt-dlp"; + # ydlp = "${pkgs.yt-dlp}/bin/yt-dlp --proxy socks5://127.0.0.1:9090"; + # ydlp2 = "${pkgs.yt-dlp}/bin/yt-dlp --proxy socks5://127.0.0.1:9091"; + ydlm = "${pkgs.yt-dlp}/bin/yt-dlp -o '%(artist)s-%(title)s.%(ext)s' --add-metadata -x --audio-quality 0"; + ydlmp = "${pkgs.yt-dlp}/bin/yt-dlp -o '%(artist)s-%(album)s/%(playlist_index)s-%(artist)s-%(title)s.%(ext)s' --add-metadata -x --audio-quality 0"; + youtube-dl = "${pkgs.yt-dlp}/bin/yt-dlp"; + + }; +}