Reorder and clean up aliases
This commit is contained in:
@@ -26,8 +26,6 @@
|
||||
# Tells vox where to find virtualenvs
|
||||
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
|
||||
|
||||
COMPASS_SKIP_ORIGIN_CHECK = "True";
|
||||
|
||||
GOPATH = "${config.home.homeDirectory}/src/go";
|
||||
GOBIN = "${config.home.homeDirectory}/src/bin";
|
||||
};
|
||||
@@ -35,20 +33,6 @@
|
||||
aliases = {
|
||||
ac = "vox activate";
|
||||
|
||||
cavg = "compass workspace exec bazel run src/go/compass.com/tools/circleci_results_cache/avg_duration/cmd/avg_duration:avg_duration";
|
||||
cbazel = "compass workspace exec bazel";
|
||||
cblack = "compass workspace run src/python3/uc/tools:run_black --";
|
||||
cbuild = "compass workspace build";
|
||||
cci = "compass workspace run src/python3/uc/tools:circleci-checks";
|
||||
ccover = "compass workspace cover --extra-cmd-args=\"--test_output=errors\"";
|
||||
cexec = "compass workspace exec";
|
||||
cgh = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/compass\" gh";
|
||||
cpip = "compass workspace run src/python3/uc/tools:run_pip_compile";
|
||||
crun = "compass workspace run";
|
||||
ctest = "compass workspace test --extra-cmd-args=\"--test_output=errors\"";
|
||||
cylint = "compass workspace run src/python3/uc/tools:run_yaml_lint";
|
||||
gazelle = "compass workspace exec bazel run :gazelle";
|
||||
|
||||
cleanup = "sudo nix-collect-garbage --delete-older-than 30d && nix store optimise";
|
||||
d = "vox deactivate";
|
||||
dirflake = "nix flake new -t github:nix-community/nix-direnv";
|
||||
@@ -58,6 +42,7 @@
|
||||
ll = "ls -l --color";
|
||||
molcol = "molecule -c ../../tests/molecule.yml";
|
||||
nixup = "nix flake lock --update-input";
|
||||
nixtest = "nixpkgs-review rev HEAD";
|
||||
pa = "cd ~/src/packaging";
|
||||
tf = "terraform";
|
||||
tsup = "sudo tailscale up";
|
||||
|
||||
@@ -31,22 +31,27 @@ def vpn(con, bwname):
|
||||
|
||||
def _unlock(args):
|
||||
bw_unlock()
|
||||
aliases['unlock'] = _unlock
|
||||
|
||||
def _ivr(args):
|
||||
vpn("350Main", "IVR Technology")
|
||||
aliases['ivr'] = _ivr
|
||||
|
||||
def _glrestart(args):
|
||||
sudo nixos-container run gitlab -- systemctl restart gitlab
|
||||
sudo nixos-container run gitlab -- systemctl restart nginx
|
||||
aliases['glrestart'] = _glrestart
|
||||
|
||||
def _cfetch(args):
|
||||
bw_unlock()
|
||||
$CIRCLECI_CLI_TOKEN=$(bw get password CircleCI)
|
||||
compass workspace exec bazel run src/go/compass.com/tools/circleci_results_cache/fetch/cmd/fetch:fetch
|
||||
aliases['cfetch'] = _cfetch
|
||||
|
||||
def _aws_creds(args):
|
||||
$AWS_ACCESS_KEY_ID=$(bw get username "AWS Access Key")
|
||||
$AWS_SECRET_ACCESS_KEY=$(bw get password "AWS Access Key")
|
||||
aliases['aws_creds'] = _aws_creds
|
||||
|
||||
def _rebuild(args):
|
||||
system = uname()
|
||||
@@ -54,17 +59,21 @@ def _rebuild(args):
|
||||
darwin-rebuild --flake ~/.config/darwin switch
|
||||
else:
|
||||
sudo nixos-rebuild switch
|
||||
aliases['rebuild'] = _rebuild
|
||||
|
||||
def _yaml2json(args, stdin=None, stdout=None):
|
||||
import sys, yaml, json
|
||||
from yaml import CLoader
|
||||
json.dump(yaml.load(stdin, Loader=CLoader), stdout, indent=4)
|
||||
aliases['yaml2json'] = _yaml2json
|
||||
|
||||
def _py2env(args):
|
||||
vox new @(args[0]) -p /usr/bin/python2
|
||||
aliases['py2env'] = _py2env
|
||||
|
||||
def _py3env(args):
|
||||
vox new @(args[0])
|
||||
aliases['py3env'] = _py3env
|
||||
|
||||
def _rundock(args):
|
||||
if Path('/usr/bin/podman').exists():
|
||||
@@ -72,10 +81,12 @@ def _rundock(args):
|
||||
else:
|
||||
e = 'docker'
|
||||
@(e) exec -ti @(args[0]) /bin/bash
|
||||
aliases['rundock'] = _rundock
|
||||
|
||||
def _pip_extras(args):
|
||||
import importlib_metadata
|
||||
print(importlib_metadata.metadata(args[0]).get_all('Provides-Extra'))
|
||||
aliases['pip_extras'] = _pip_extras
|
||||
|
||||
# Container stuff
|
||||
def _newdock(args):
|
||||
@@ -85,9 +96,11 @@ def _newdock(args):
|
||||
e = 'docker'
|
||||
@(e) run -P --privileged=true -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v @(getcwd()):/dmnt -v /etc/pki:/etc/pki:ro -d --name @(args[1]) @(args[0]) /sbin/init
|
||||
rundock @(args[1])
|
||||
aliases['newdock'] = _newdock
|
||||
|
||||
def _unknown_host(args):
|
||||
sed -i -e @(args[0])d ~/.ssh/known_hosts
|
||||
aliases['unknown_host'] = _unknown_host
|
||||
|
||||
def _bake(args):
|
||||
from pathlib import Path
|
||||
@@ -95,21 +108,8 @@ def _bake(args):
|
||||
if not templates.exists():
|
||||
git clone src:greg/copier-templates.git ~/.copier-templates
|
||||
copier copy @(str(templates / args[0])) .
|
||||
|
||||
aliases['aws_creds'] = _aws_creds
|
||||
aliases['glrestart'] = _glrestart
|
||||
aliases['bake'] = _bake
|
||||
aliases['unlock'] = _unlock
|
||||
aliases['cfetch'] = _cfetch
|
||||
aliases['ivr'] = _ivr
|
||||
aliases['newdock'] = _newdock
|
||||
aliases['pip_extras'] = _pip_extras
|
||||
aliases['py2env'] = _py2env
|
||||
aliases['py3env'] = _py3env
|
||||
aliases['rebuild'] = _rebuild
|
||||
aliases['rundock'] = _rundock
|
||||
aliases['unknown_host'] = _unknown_host
|
||||
aliases['yaml2json'] = _yaml2json
|
||||
|
||||
###
|
||||
#
|
||||
# Other random nice-to-have things
|
||||
|
||||
Reference in New Issue
Block a user