From cb6f1e5be9cbe7ffe27f1b3c0e4377198f24d56f Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 11 Aug 2024 00:10:10 +0200 Subject: [PATCH] =?UTF-8?q?=C3=B8lka=C3=B8lkafosf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/pbsds/home/default.nix | 15 ++++++--------- users/pbsds/home/profiles/git.nix | 9 ++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/users/pbsds/home/default.nix b/users/pbsds/home/default.nix index 9f368c2..ab6bde7 100644 --- a/users/pbsds/home/default.nix +++ b/users/pbsds/home/default.nix @@ -33,10 +33,11 @@ nix run nixpkgs#atom -- --disable-gpu --in-process-gpu --no-sandbox "$@" } - function vpn { - ip="$(dig +short -x a $1 | tail -n 1)" - ( set -x; sshuttle 0.0.0.0/0 --disable-ipv6 --dns -r "$1" -x $ip -x 127.0.0.1 -x 172.0.0.0/8 ) - } + if [[ -n "''${SSH_CLIENT-}" || -n "''${SSH_TTY-}" || -z "''${WAYLAND_DISPLAY-}" ]]; then + alias clip="xclip -sel clip -i -rmlastnl -t text/plain"; + else + alias clip="wl-copy --trim-newline --type text/plain"; + fi ''; home.packages = with pkgs; [ @@ -65,7 +66,7 @@ vgmstream ffmpeg-full - (pkgs.termsvg or pkgs.unstable.termsvg) + /* (pkgs.termsvg or pkgs.unstable.termsvg) */ lolcat toilet @@ -125,10 +126,6 @@ #TODO: vpn - # TODO: fix both wayland, and x-forwarding - #clip = "( if command -v wl-copy >/dev/null; then wl-copy --trim-newline --type text/plain; else xclip -sel clip -t text/plain -rmlastnl -i; fi )"; - clip = "xclip -sel clip -i -rmlastnl -t text/plain"; - # TODO: ps1? pwd-fqdn = ''echo "$(whoami)@$(hostname -f):$(printf "%q" "$(realpath .)/")"''; diff --git a/users/pbsds/home/profiles/git.nix b/users/pbsds/home/profiles/git.nix index 7615785..b14be44 100644 --- a/users/pbsds/home/profiles/git.nix +++ b/users/pbsds/home/profiles/git.nix @@ -50,7 +50,6 @@ home.shellAliases = { # git gud gs = "git status"; - gb = "git blame"; gl = "git log --oneline --color | head -n 30"; glg = "git log --all --decorate --oneline --graph"; gpra = "git pull --rebase --autostash"; @@ -63,11 +62,11 @@ gcp = "git cherry-pick"; gca = "git commit --amend"; gcara = "git commit --amend --reset-author"; - gpo = "git push origin"; - gpasr = "git pull --autostash --rebase"; - #gfr = "git fetch origin master && git rebase FETCH_HEAD"; gfr = "git pull --rebase"; - gp = "git pull --rebase --autostash"; + gc = "git branch | cut -c2- | gum choose | xargs git checkout"; + gbrm = "git fetch origin; git branch --merged | cut -c3- | grep -vE '^(main|master)$' | gum choose --no-limit --header 'Which branches to delete:' | xargs git branch -D"; + #gb = "git blame"; + #gpo = "git push origin"; }; }