about summary refs log tree commit diff
path: root/users/riking
diff options
context:
space:
mode:
Diffstat (limited to 'users/riking')
-rw-r--r--users/riking/OWNERS3
-rw-r--r--users/riking/dotfiles/.mybashrc53
-rw-r--r--users/riking/dotfiles/fish/config.fish8
-rw-r--r--users/riking/dotfiles/fish/fish_variables32
-rw-r--r--users/riking/dotfiles/fish/functions/ddate.fish3
-rw-r--r--users/riking/dotfiles/fish/functions/gh-clone.fish18
-rw-r--r--users/riking/dotfiles/fish/functions/prodaccess.fish6
-rw-r--r--users/riking/dotfiles/fish/functions/reset-audio.fish4
-rw-r--r--users/riking/dotfiles/fish/functions/tvl-push.fish3
-rw-r--r--users/riking/keys.nix20
10 files changed, 150 insertions, 0 deletions
diff --git a/users/riking/OWNERS b/users/riking/OWNERS
new file mode 100644
index 000000000000..a39f4cd9f0ae
--- /dev/null
+++ b/users/riking/OWNERS
@@ -0,0 +1,3 @@
+inherit: false
+owners:
+ - riking
diff --git a/users/riking/dotfiles/.mybashrc b/users/riking/dotfiles/.mybashrc
new file mode 100644
index 000000000000..c5ebc34a1f4f
--- /dev/null
+++ b/users/riking/dotfiles/.mybashrc
@@ -0,0 +1,53 @@
+
+# BEGIN: __USER_FUNCTIONS__
+function gh-clone() {
+	if [[ "x$2" == "x" ]]; then
+		IFS='/' read -ra PARTS <<< "$1"
+		user="${PARTS[0]}"
+		repo="${PARTS[1]}"
+	else
+		user="$1"
+		repo="$2"
+	fi
+	if [[ -d ~/go/src/github.com/"$user"/"$repo" ]]; then
+		cd ~/go/src/github.com/"${user}"/"${repo}"
+		return 0
+	fi
+	mkdir -p ~/go/src/github.com/"${user}"
+	cd ~/go/src/github.com/"${user}"
+	git clone git@github.com:"${user}"/"${repo}".git
+	cd ~/go/src/github.com/"${user}"/"${repo}"
+}
+
+function download() {
+	cd "${HOME}/Downloads"
+	wget "$@"
+}
+
+# todo: only one password pls
+function prodaccess() {
+	(ssh-add -L | grep -q 'ZgEu6S3SLatYN') || ssh-add "$HOME"/.ssh/id_ed25519
+	(ssh-add -L | grep -q 'Gfh2S3kUwZ8A6') || ssh-add "$HOME"/.ssh/id_rsa.discourse
+	echo "signing test" | gpg --clearsign > /dev/null
+}
+
+function reset-audio() {
+	pulseaudio -k && sudo alsa force-reload
+}
+
+function tvl-push() {
+	git push origin HEAD:refs/for/canon
+}
+
+# END: __USER_FUNCTIONS__
+
+# BEGIN: __USER_ENV__
+GOPATH=$HOME/go
+CDPATH=$HOME/go/src
+export GPG_TTY="$(tty)"
+
+export PATH="/usr/local/go/bin:$HOME/go/bin:$HOME/.rbenv/bin:$PATH"
+
+eval "$(rbenv init -)"
+# END: __USER_ENV__
+
diff --git a/users/riking/dotfiles/fish/config.fish b/users/riking/dotfiles/fish/config.fish
new file mode 100644
index 000000000000..c2454762bddf
--- /dev/null
+++ b/users/riking/dotfiles/fish/config.fish
@@ -0,0 +1,8 @@
+set -gx GOPATH "$HOME/go"
+set -gx GPG_TTY (tty)
+set -gx DEPOT_ROOT "$GOPATH/src/code.tvl.fyi"
+
+set -gx PATH '/usr/local/go/bin' "$HOME/.cargo/bin" "$HOME/.rbenv/bin" $PATH
+status --is-interactive; and rbenv init - | source
+source ~/.opsrc.fish # work
+set -gx PATH "$HOME/go/bin" $PATH
diff --git a/users/riking/dotfiles/fish/fish_variables b/users/riking/dotfiles/fish/fish_variables
new file mode 100644
index 000000000000..fa8bff919f40
--- /dev/null
+++ b/users/riking/dotfiles/fish/fish_variables
@@ -0,0 +1,32 @@
+# This file contains fish universal variable definitions.
+# VERSION: 3.0
+SETUVAR __fish_initialized:3100
+SETUVAR fish_color_autosuggestion:555\x1ebrblack
+SETUVAR fish_color_cancel:\x2dr
+SETUVAR fish_color_command:005fd7
+SETUVAR fish_color_comment:990000
+SETUVAR fish_color_cwd:green
+SETUVAR fish_color_cwd_root:red
+SETUVAR fish_color_end:009900
+SETUVAR fish_color_error:ff0000
+SETUVAR fish_color_escape:00a6b2
+SETUVAR fish_color_history_current:\x2d\x2dbold
+SETUVAR fish_color_host:normal
+SETUVAR fish_color_host_remote:yellow
+SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
+SETUVAR fish_color_normal:normal
+SETUVAR fish_color_operator:00a6b2
+SETUVAR fish_color_param:00afff
+SETUVAR fish_color_quote:999900
+SETUVAR fish_color_redirection:00afff
+SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
+SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
+SETUVAR fish_color_status:red
+SETUVAR fish_color_user:brgreen
+SETUVAR fish_color_valid_path:\x2d\x2dunderline
+SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell\x0aType\x20\x60help\x60\x20for\x20instructions\x20on\x20how\x20to\x20use\x20fish
+SETUVAR fish_key_bindings:fish_default_key_bindings
+SETUVAR fish_pager_color_completion:\x1d
+SETUVAR fish_pager_color_description:B3A06D\x1eyellow
+SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
+SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
diff --git a/users/riking/dotfiles/fish/functions/ddate.fish b/users/riking/dotfiles/fish/functions/ddate.fish
new file mode 100644
index 000000000000..8152d31680e7
--- /dev/null
+++ b/users/riking/dotfiles/fish/functions/ddate.fish
@@ -0,0 +1,3 @@
+function ddate --description 'current date in Discourse format'
+    TZ=UTC date '+[date=%Y-%m-%d time=%H:%M:%S timezone=\"%Z\"]'
+end
diff --git a/users/riking/dotfiles/fish/functions/gh-clone.fish b/users/riking/dotfiles/fish/functions/gh-clone.fish
new file mode 100644
index 000000000000..109ec353f6db
--- /dev/null
+++ b/users/riking/dotfiles/fish/functions/gh-clone.fish
@@ -0,0 +1,18 @@
+function gh-clone --description 'Clone and CD to a github repository'
+    if test (count $argv) -eq 1
+        set user (string split "/" -- $argv[1])[1]
+        set repo (string split "/" -- $argv[1])[2]
+    else
+        set user $argv[1]
+        set repo $argv[2]
+    end
+
+    if test -d "$HOME/go/src/github.com/$user/$repo"
+        cd "$HOME/go/src/github.com/$user/$repo"
+        return 0
+    end
+    mkdir -p "$HOME/go/src/github.com/$user"
+    cd "$HOME/go/src/github.com/$user"
+    git clone "git@github.com:$user/$repo.git"
+    cd "$HOME/go/src/github.com/$user/$repo"
+end
diff --git a/users/riking/dotfiles/fish/functions/prodaccess.fish b/users/riking/dotfiles/fish/functions/prodaccess.fish
new file mode 100644
index 000000000000..876c14c5e31e
--- /dev/null
+++ b/users/riking/dotfiles/fish/functions/prodaccess.fish
@@ -0,0 +1,6 @@
+function prodaccess
+    ssh-add "$HOME/.ssh/id_ecdsa_sk"
+    begin; ssh-add -L | grep -q 'ZgEu6S3SLatYN'; end || ssh-add "$HOME"/.ssh/id_ed25519
+    begin; ssh-add -L | grep -q 'Gfh2S3kUwZ8A6'; end || ssh-add "$HOME"/.ssh/id_rsa.discourse
+    echo "signing test" | gpg --clearsign > /dev/null
+end
diff --git a/users/riking/dotfiles/fish/functions/reset-audio.fish b/users/riking/dotfiles/fish/functions/reset-audio.fish
new file mode 100644
index 000000000000..eb48578a52bc
--- /dev/null
+++ b/users/riking/dotfiles/fish/functions/reset-audio.fish
@@ -0,0 +1,4 @@
+function reset-audio --description "Resets pulse and alsa"
+    pulseaudio -k
+    sudo alsa force-reload
+end
diff --git a/users/riking/dotfiles/fish/functions/tvl-push.fish b/users/riking/dotfiles/fish/functions/tvl-push.fish
new file mode 100644
index 000000000000..f04ac830c005
--- /dev/null
+++ b/users/riking/dotfiles/fish/functions/tvl-push.fish
@@ -0,0 +1,3 @@
+function tvl-push
+    git push origin HEAD:refs/for/canon
+end
diff --git a/users/riking/keys.nix b/users/riking/keys.nix
new file mode 100644
index 000000000000..6dd2ff18a30f
--- /dev/null
+++ b/users/riking/keys.nix
@@ -0,0 +1,20 @@
+# SSH public keys
+{ ... }:
+
+rec {
+  sk-ecljg09 = "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBBwJ7dJJUkvIK+bDsVsCsCZSlbs90aOLsHN7XesC8/AmLA5rIRLO8I5ADoOjsWAXl/WAgxqOMmB4LxZjoXWa1a0AAAAEc3NoOg== riking@sk-ECLJG09";
+  sk-portable1 = "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBCfA8/0nKk4jXclWHjRZIuicPeyIo9oDwahpnWjEATr7YaFDAo632KTSgqlW0lpx8lX9alLsJRhFV2XaSurYw/EAAAAEc3NoOg== riking@sk-portable1";
+  sk-portable2 = "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBEX3DXreQR93SR68QZHTdaVd5RjlRM8C0jcZ4kI4OZwqk7xuk68w3g22q2OM7O+chj+n1N3u0hLxi82QfRnwyasAAAAEc3NoOg== riking@sk-portable2";
+  sk-desktop = "sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBB+JvN8nAxD+yo49Ohf/UDq7Z049yvkURJIA1XNbvKaAkvfWnCN5m9vTC1FyGxTyCwy4QpD1pFP5fIn0X/kvvfgAAAAEc3NoOg== riking@sk-kane-DAN-A4";
+
+  u2f = [sk-ecljg09 sk-portable1 sk-portable2 sk-desktop];
+
+  ed1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAjWIfFH2bAWMZG+HudV1MVHWUl83M/ZgEu6S3SLatYN riking@kane-DAN-A4";
+  ed2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICBblB4C9IgAijv+qN6Zs8TM2Sz7phQvVmRrcDn4VYNo riking@ECLJG09";
+
+  passworded = [ed1 ed2];
+
+  unprotected = [];
+
+  all = u2f ++ passworded ++ unprotected;
+}