Cleanup aliases
Make Xonsh aliases nicer Organize the ones in my config Enhance the cleanup alias to include home-manager generations Create aliases as Python raw strings
This commit is contained in:
@@ -32,24 +32,29 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
|
# Python related ones
|
||||||
ac = "vox activate";
|
ac = "vox activate";
|
||||||
|
|
||||||
cleanup = "sudo nix-collect-garbage --delete-older-than 30d && nix store optimise";
|
|
||||||
d = "vox deactivate";
|
d = "vox deactivate";
|
||||||
dirflake = "nix flake new -t github:nix-community/nix-direnv";
|
|
||||||
gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh";
|
# Nix related ones
|
||||||
gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx";
|
gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx";
|
||||||
ls = "ls --color";
|
|
||||||
ll = "ls -l --color";
|
|
||||||
molcol = "molecule -c ../../tests/molecule.yml";
|
|
||||||
nixup = "nix flake lock --update-input";
|
nixup = "nix flake lock --update-input";
|
||||||
nixtest = "nixpkgs-review rev HEAD";
|
nixtest = "nixpkgs-review rev HEAD";
|
||||||
pa = "cd ~/src/packaging";
|
nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\"";
|
||||||
|
|
||||||
|
# General
|
||||||
|
gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh";
|
||||||
|
ls = "ls --color";
|
||||||
|
ll = "ls -l --color";
|
||||||
tf = "terraform";
|
tf = "terraform";
|
||||||
|
|
||||||
|
# Tailscale related ones
|
||||||
tsup = "sudo tailscale up";
|
tsup = "sudo tailscale up";
|
||||||
tspub = "sudo tailscale up --exit-node=linode";
|
tspub = "sudo tailscale up --exit-node=linode";
|
||||||
tshome = "sudo tailscale up --exit-node=2maccabees";
|
tshome = "sudo tailscale up --exit-node=2maccabees";
|
||||||
tsclear = "sudo tailscale up --exit-node=''";
|
tsclear = "sudo tailscale up --exit-node=''";
|
||||||
|
|
||||||
|
# Vagrant related
|
||||||
vdown = "vagrant destroy";
|
vdown = "vagrant destroy";
|
||||||
vhalt = "vagrant halt";
|
vhalt = "vagrant halt";
|
||||||
vos = "vagrant up --provision --provider openstack";
|
vos = "vagrant up --provision --provider openstack";
|
||||||
|
|||||||
@@ -110,6 +110,12 @@ def _bake(args):
|
|||||||
copier copy @(str(templates / args[0])) .
|
copier copy @(str(templates / args[0])) .
|
||||||
aliases['bake'] = _bake
|
aliases['bake'] = _bake
|
||||||
|
|
||||||
|
def _cleanup(args):
|
||||||
|
sudo nix profile wipe-history --profile ~/.local/state/nix/profiles/home-manager --older-than '30d'
|
||||||
|
sudo nix-collect-garbage --delete-older-than 30d
|
||||||
|
sudo nix store optimise
|
||||||
|
aliases['cleanup'] = _cleanup
|
||||||
|
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# Other random nice-to-have things
|
# Other random nice-to-have things
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ in with lib; {
|
|||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
shortAliases = concatStringsSep "\n" (
|
shortAliases = concatStringsSep "\n" (
|
||||||
mapAttrsToList (k: v: "aliases['${k}']='${v}'") cfg.aliases
|
mapAttrsToList (k: v: "aliases['${k}']=r'${v}'") cfg.aliases
|
||||||
);
|
);
|
||||||
|
|
||||||
listToPythonList = let
|
listToPythonList = let
|
||||||
|
|||||||
Reference in New Issue
Block a user