teutat3s: mnx: add prr, github API token, mnx git config

Cleanup unused zshrc
This commit is contained in:
teutat3s 2023-05-31 20:53:16 +02:00
parent 067286461e
commit ca61200807
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
10 changed files with 85 additions and 105 deletions

View file

@ -20,6 +20,13 @@ in {
owner = "teutat3s"; owner = "teutat3s";
}; };
age.secrets.github-api-token = {
file = "${self}/secrets/github-api-token.age";
mode = "600";
owner = "teutat3s";
path = "/home/${psCfg.user.name}/.local/share/github/api-token";
};
pub-solar = { pub-solar = {
audio.mopidy.enable = lib.mkForce false; audio.mopidy.enable = lib.mkForce false;
core.hibernation = { core.hibernation = {

View file

@ -0,0 +1,13 @@
diff --git a/lib/prr.js b/lib/prr.js
index f654142..c1b0e41 100755
--- a/lib/prr.js
+++ b/lib/prr.js
@@ -133,7 +133,7 @@ function determineGitRepo(args, cb) {
return;
}
- var url = stdout.replace(/\n/, '');
+ var url = stdout.replace(/\/?\n/, '');
var gitUser = '';
var gitRepoName = '';

32
overlays/prr.nix Normal file
View file

@ -0,0 +1,32 @@
final: prev: {
prr = prev.buildNpmPackage {
pname = "prr";
version = "unstable-2022-06-05";
src = prev.fetchFromGitHub {
owner = "TritonDataCenter";
repo = "prr";
rev = "bfbce27d955b6b75729ef647cec9f81dc04fea3c";
hash = "sha256-Z5sKddpHmSJxzacMOuDOxMxBpjApS7FWCWRelHMi/4g=";
};
npmDepsHash = "sha256-wVh3WCuUn9l/gILx25tgxTwtwH0Q19lpXTU8gOHWsCg=";
patches = [./prr-remote-origin-trailing-slash.patch];
dontBuild = true;
installPhase = ''
npmInstallHook
mkdir -p $out/bin
ln -s $out/lib/node_modules/prr/bin/prr $out/bin/prr
'';
meta = with prev.lib; {
homepage = "https://github.com/TritonDataCenter/prr";
description = "Tooling to assist with GitHub pull requests";
platforms = ["x86_64-linux"];
maintainers = with maintainers; [teutat3s];
};
};
}

View file

@ -0,0 +1,13 @@
age-encryption.org/v1
-> ssh-ed25519 Wp/X/Q CO4vIjn5gn0a8UIGQ8pTtd3bLimnlvXXFVHrIdvhhzE
vZT3aoWvnK4aPMR+yZn8hJ63F/1Ga7xx6Nq8UN4bsIM
-> ssh-ed25519 8U1+ng Nu+OuQ0jipmVBhUL5aJzgRYIP711yH9A/UwNxDCt8i0
YW38h5abfi8EKnTrE4sLUAd5i+u4+qNno/Wzy9CReHM
-> ssh-ed25519 BVsyTA +um+6g0wccymBjOdKJs2FR58ReTClufGPFyHgQwR/RA
/Cv2hCYaV1E4dgzXY2oFyXhQt/m/u4KUaBByIv8Wfn8
-> piv-p256 xGzyzw Ar9I/qIkystt/yiYJHut4D94ERTP1ZTh3WRBpV1cvZ1r
UjUpz3egN/5N4n/xabKy3DE/8rLWDsYGWgB4IE5BFxk
-> 7-grease aAc9hT yzd(M6l 1j> @y>y
iNZSjN0
--- 2dlb9E0gTnsnkTNEK45p5/bSHDhp53Ni+J86mJYgRnY
3rÞ$šAüw,3WzLÅ<4C>ä66<36>H²é e¸ØRÙíX~†Ûð¤xª)g¨"ÝûÝ'òŠ{­ö‡4#ÂÑig¸ñìoëQ

View file

@ -12,6 +12,7 @@ let
in { in {
"example-secret.age".publicKeys = allKeys; "example-secret.age".publicKeys = allKeys;
"environment-secrets.age".publicKeys = allKeys; "environment-secrets.age".publicKeys = allKeys;
"github-api-token.age".publicKeys = allKeys;
"fwknoprc.age".publicKeys = allKeys; "fwknoprc.age".publicKeys = allKeys;
"cat-testenv.ovpn.age".publicKeys = allKeys; "cat-testenv.ovpn.age".publicKeys = allKeys;
"docker-ci-runner-secrets.age".publicKeys = allKeys; "docker-ci-runner-secrets.age".publicKeys = allKeys;

View file

@ -21,6 +21,11 @@ in
[includeIf "gitdir:~/CodeRoom/greenbaum.cloud/"] [includeIf "gitdir:~/CodeRoom/greenbaum.cloud/"]
path = ~/.config/git/config_greenbaum.cloud path = ~/.config/git/config_greenbaum.cloud
[includeIf "gitdir:~/CodeRoom/github.com/TritonDataCenter/"]
path = ~/.config/git/config_mnx
[includeIf "gitdir:~/CodeRoom/github.com/mnx-solutions/"]
path = ~/.config/git/config_mnx
[includeIf "gitdir:~/CodeRoom/git.b12f.io/"] [includeIf "gitdir:~/CodeRoom/git.b12f.io/"]
path = ~/.config/git/config_git.b12f.io path = ~/.config/git/config_git.b12f.io
[includeIf "gitdir:~/CodeRoom/git.pub.solar/"] [includeIf "gitdir:~/CodeRoom/git.pub.solar/"]

View file

@ -0,0 +1,9 @@
{
config,
pkgs,
...
}: let
in '' [user]
name = Jhonas Wernery
email = jhonas.wernery@mnxsolutions.com
signingkey = 9C1D348ACDAFB311''

View file

@ -45,6 +45,10 @@ in {
inherit config; inherit config;
inherit pkgs; inherit pkgs;
}; };
xdg.configFile."git/config_mnx".text = import ./.config/git/config_mnx.nix {
inherit config;
inherit pkgs;
};
xdg.configFile."git/config_git.b12f.io".text = import ./.config/git/config_git.b12f.io.nix { xdg.configFile."git/config_git.b12f.io".text = import ./.config/git/config_git.b12f.io.nix {
inherit config; inherit config;
inherit pkgs; inherit pkgs;

View file

@ -27,6 +27,7 @@ in {
home.packages = with pkgs; [ home.packages = with pkgs; [
zoom-us zoom-us
slack slack
prr
]; ];
}; };
}; };

View file

@ -1,105 +0,0 @@
{
config,
pkgs,
tritonshell,
...
}: ''
bindkey "^[[1;3D" backward-word
bindkey "^[[1;3C" forward-word
bindkey "^[p" backward-word
bindkey "^[n" forward-word
# make cursor jump to slash, period, dash, underscore, dollar sign, equals sign
# by default: export WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>'
export WORDCHARS='*?[]~&;!#$%^(){}'
# Alt+Backspace stops at /
bindkey "^[^?" backward-kill-word
backward-kill-dir () {
local WORDCHARS=''${WORDCHARS/\/}
zle backward-kill-word
}
zle -N backward-kill-dir
bindkey '^[^?' backward-kill-dir
# git aliases
alias ga="git add"
alias gau="git add --update"
alias gb="git branch"
alias gbd="git branch --delete"
alias gc="git commit"
alias gcm="git commit --message"
alias gco="git checkout"
alias gcob="git checkout -b"
alias gd="git diff"
alias gm="git merge"
alias gma="git merge --abort"
alias gmc="git merge --continue"
alias gp="git pull"
alias gs="git status"
# misc aliases
alias zshconfig="vim ~/.zshrc"
alias zshhistory="vim $XDG_DATA_HOME/zsh/zsh_history"
alias zshsource="source ~/.zshrc"
alias tp="triton profile set"
alias tt="triton"
alias ttco="triton-compose"
alias tf="terraform"
alias dstart="sudo systemctl start docker"
alias dstop="sudo systemctl stop docker"
alias lvstart="sudo systemctl start libvirtd"
alias lvstop="sudo systemctl stop libvirtd"
alias wg-up="sudo systemctl start wg-quick@wg0.service"
alias wg-down="sudo systemctl stop wg-quick@wg0.service"
# Helper function for docker on triton
ttp() {
if [[ "$1" == "set" ]]; then
if [[ -n "$2" ]]; then
source ${tritonshell.packages.${pkgs.system}.triton-utils}/bin/unset-env.sh
triton profile set "$2"
fi
source ${tritonshell.packages.${pkgs.system}.triton-docker-env}/bin/triton-docker-env.sh
elif [[ "$1" == "unset" ]]; then
source ${tritonshell.packages.${pkgs.system}.triton-utils}/bin/unset-env.sh
elif [[ "$1" == "env" ]]; then
env | grep "DOCKER\|MANTA\|SDC\|TRITON" | sort
else
echo "this is a helper function to quickly switch triton profiles"
echo "and setup the required environment variables"
echo "for triton, manta and the remote docker host (API)"
echo
echo 'use "ttp set your-profile" to switch to a profile'
echo
echo 'use "ttp unset" to clear all environment variables used by these CLIs'
echo "useful if you'd like to run a docker command against the"
echo "local docker host"
echo
echo 'use "ttp env" to view the currently set environment variables'
echo "used by the triton & manta CLIs"
echo
echo 'use "ttp help" to view this help'
fi
}
# remove @machine from prompt
DEFAULT_USER=$(whoami)
# autocomplete cd ..
zstyle ':completion:*' special-dirs true
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C ${pkgs.consul}/bin/consul consul
complete -o nospace -C ${pkgs.nomad_1_4}/bin/nomad nomad
complete -o nospace -C ${pkgs.vault}/bin/vault vault
complete -o nospace -C ${pkgs.terraform}/bin/terraform terraform
complete -o nospace -C ${pkgs.waypoint}/bin/waypoint waypoint
complete -C '${pkgs.awscli2}/bin/aws_completer' ${pkgs.awscli2}/bin/aws
source ${config.age.secrets.environment-secrets.path}
''