diff --git a/switch b/switch index bf5697d655d9362730c9db9854db34b7950154fc..04af03eb5978615a646d5094da65c81dc95f7d60 100755 --- a/switch +++ b/switch @@ -1,16 +1,17 @@ #!/bin/sh +set -e +cd "$(dirname "$0")" nh_subcommand="os" fallback_command="nixos-rebuild" -hostname_file="$(dirname "$0")/.hostname" if [ -n "$1" ]; then hostname="$1" -elif [ -f "$hostname_file" ]; then - hostname=$(cat "$hostname_file") +elif [ -f ".hostname" ]; then + hostname=$(cat .hostname) fi if [ -z "$hostname" ]; then hostname="$(hostname)" fi -printf "%s" "$hostname" >"$hostname_file" +printf "%s" "$hostname" >.hostname if [ "$(uname -o)" = "Darwin" ]; then nh_subcommand="darwin" fallback_command="nix run .#darwin-rebuild" diff --git a/users/clover/home.nix b/users/clover/home.nix index bf3d6838a0719a93f9c88a12d087b6345d6b36cd..5fb0d3e278fe30910d702ec5e12ed553fc1461e3 100644 --- a/users/clover/home.nix +++ b/users/clover/home.nix @@ -48,9 +48,10 @@ in settings = { theme = "light:Farmhouse Light,dark:Challenger Deep"; font-family = "AT Name Mono"; - adjust-cursor-thickness = 1; - background-opacity = 0.9; + adjust-cursor-thickness = 2; + background-opacity = 0.95; background-blur = true; + unfocused-split-opacity = 1; }; }; @@ -59,10 +60,16 @@ in enable = true; shellAliases = { switch = "~/config/switch"; - gg = "lazygit"; - ga = "git add"; - g = "git status"; - gp = "git pull --rebase && git push"; + + # move a bookmark from the previous commit + jf = "jj git fetch"; + e = "jj edit"; + d = "jj desc"; + bup = "jj b m --from 'parents(@)' --to '@'"; + push = "jj git push"; + moveself = "jj rebase -r @ -d"; + logall = "jj log -r 'all()'"; + cherry = "jj git fetch && jj split -i -p -m 'SPLIT_CHANGES' && jj edit -r 'description(\"SPLIT_CHANGES\")' && jj desc -m '' --edit"; }; initContent = '' export PS1="%{$(tput setaf 207)%}%m%{$(tput setaf 15)%}:%{$(tput setaf 87)%}%~ %{$(tput sgr0)%}$ " @@ -74,6 +81,21 @@ in fi uv run --project "$dirname" "$@" } + + function pr() { + message=$(jj log -r '@' -T 'description' --no-graph) + if [[ -z "$message" ]] || [[ "$message" = "WIP:"* ]]; then + jj desc + fi + if [ -n "$1" ]; then + jj git push --named "clo/$1"=@ + branch="clo/$1" + else + branch="$(jj log -r '@' -T '"clo/push-" ++ change_id.short()' --no-graph)" + jj git push -c @ + fi + open "$(git remote get-url origin | sed 's/git@github\.com:/https:\/\/github.com\//' | sed 's/\.git$//')/compare/master...$branch" + } ''; }; diff --git a/users/clover/work/home.nix b/users/clover/work/home.nix index a5fb595349707f6b857c0e40e4208e08ccdeb756..3dcb3ea9c5e53de6b451d59bbcbb3d78a1cff0cf 100644 --- a/users/clover/work/home.nix +++ b/users/clover/work/home.nix @@ -10,10 +10,10 @@ }; home.packages = with pkgs; [ (bun.overrideAttrs (_: rec { - version = "1.1.17"; + version = "1.3.0"; src = fetchurl { url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-aarch64.zip"; - hash = "sha256-aULgRZ9evcGUhKJ6slLJOg3IEzUeNfIkJF8RDP3YUlo="; + hash = "sha256-hYSOP5ZIHvyr51pQD9O5S5u5VoaretCjiSl2x74VA2o="; }; })) doppler