diff --git a/.bashrc.d/10_env.sh b/.bashrc.d/10_env.sh index 36c4b545..c422cfdd 100644 --- a/.bashrc.d/10_env.sh +++ b/.bashrc.d/10_env.sh @@ -6,12 +6,13 @@ export PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games export PATH="$HOME"/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:"$PATH" export PATH="$HOME"/.cargo/bin:"$PATH" export PATH="$HOME"/.cabal/bin:"$PATH" +export PATH="$HOME"/.local/share/mise/shims:"$PATH" +export PATH="$HOME"/.local/bin:"$PATH" +export PATH="$HOME"/bin/.ext:"$PATH" +export PATH="$HOME"/bin/.ext-npm:"$PATH" export PATH="$HOME"/bin/.untracked:"$PATH" export PATH="$HOME"/bin/.aliases:"$PATH" export PATH="$HOME"/bin:"$PATH" -export PATH="$HOME"/bin/.ext:"$PATH" -export PATH="$HOME"/bin/.ext-npm:"$PATH" -export PATH="$HOME"/.local/bin:"$PATH" # manpath only for manpath in "$HOME"/.local/share/man/.manpath/*; do diff --git a/.config/git/ignore b/.config/git/ignore index 5a5f7e30..c84d96f4 100644 --- a/.config/git/ignore +++ b/.config/git/ignore @@ -1,3 +1,4 @@ .envrc +.mise.local.toml .stack-work/ node_modules/ diff --git a/.config/mise/.gitignore b/.config/mise/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/.config/mise/config.toml b/.config/mise/config.toml new file mode 100644 index 00000000..a5de5f1a --- /dev/null +++ b/.config/mise/config.toml @@ -0,0 +1,12 @@ +[settings] +experimental = true +not_found_auto_install = false +paranoid = true + +[settings.status] +missing_tools = "always" +show_env = true + +[tools] +"ubi:cargo-bins/cargo-binstall" = "v1.10.5" +usage = "0.3.1" diff --git a/.local/share/mise/Makefile b/.local/share/mise/Makefile new file mode 100644 index 00000000..6e61c64f --- /dev/null +++ b/.local/share/mise/Makefile @@ -0,0 +1,11 @@ +.PHONY: all +all: shims/cargo-binstall + mise install + +# FIXME: workaround for https://github.com/jdx/mise/issues/2260 +shims/cargo-binstall: + mise install ubi:cargo-bins/cargo-binstall + +.PHONY: gc +gc: + mise prune diff --git a/Makefile b/Makefile index 248f1ac1..a1f7b885 100644 --- a/Makefile +++ b/Makefile @@ -33,14 +33,15 @@ SUBDIRS_EXCLUDE := docs/resume-cv .xmonad-testing ## Invoke make for all subdirs with Makefiles all: $(filter-out $(SUBDIRS_EXCLUDE),$(SUBDIRS)) -.cargo/bin: bin/.ext -.rustup: bin/.ext +.cargo/bin: .local/share/mise +.local/share/mise: bin/.ext .rustup ## Invoke "make gc" in sub-Makefiles gc: .cargo/bin%gc gc: bin/.ext%gc gc: bin/.ext-npm%gc gc: src-elixir%gc +gc: .local/share/mise%gc .PHONY: $(filter bootstrap.sh,$(MAKECMDGOALS)) all: bootstrap.sh diff --git a/bin/.ext/.gitignore b/bin/.ext/.gitignore index 9dda5ab7..cea5fea2 100644 --- a/bin/.ext/.gitignore +++ b/bin/.ext/.gitignore @@ -1,6 +1,5 @@ /.ext-* /buildifier -/cargo-binstall /ctlptl /dive /docker-buildx diff --git a/bin/.ext/Makefile b/bin/.ext/Makefile index 37d18be2..6aecb0ae 100644 --- a/bin/.ext/Makefile +++ b/bin/.ext/Makefile @@ -4,7 +4,6 @@ all: CURL := curl -LSsf BUILDIFIER_VERSION := v7.1.2 -CARGO_BINSTALL_VERSION := v1.10.2 CIRCLECI_CLI_VERSION := v0.1.30549 CTLPTL_VERSION := v0.8.32 DIVE_VERSION := v0.12.0 @@ -30,7 +29,6 @@ TZ_VERSION := v0.7.0 UBI_VERSION := v0.1.1 BUILDIFIER_GITHUB := bazelbuild/buildtools -CARGO_BINSTALL_GITHUB := cargo-bins/cargo-binstall CIRCLECI_CLI_GITHUB := CircleCI-Public/circleci-cli CTLPTL_GITHUB := tilt-dev/ctlptl DIVE_GITHUB := wagoodman/dive @@ -165,14 +163,6 @@ kind: | .ext-kind ; ln -fsT $| $@ $(CURL) -o $@ https://github.com/$(KIND_GITHUB)/releases/download/$(KIND_VERSION)/kind-linux-amd64 chmod +x $@ -all: cargo-binstall -cargo-binstall: | .ext-cargo-binstall ; ln -fsT $|/$@ $@ -.ext-cargo-binstall: .ext-cargo-binstall-$(CARGO_BINSTALL_VERSION) ; ln -fsT $< $@ -.ext-cargo-binstall-$(CARGO_BINSTALL_VERSION): - mkdir -p $@ - $(CURL) https://github.com/$(CARGO_BINSTALL_GITHUB)/releases/download/$(CARGO_BINSTALL_VERSION)/cargo-binstall-x86_64-unknown-linux-gnu.tgz \ - | tar -x -z -C $@ cargo-binstall - all: fclones fclones: | .ext-fclones ; ln -fsT $|/$@ $@ .ext-fclones: .ext-fclones-$(FCLONES_VERSION) ; ln -fsT $< $@ diff --git a/bin/bwrap-home b/bin/bwrap-home index 78801ac0..8ed449b8 100755 --- a/bin/bwrap-home +++ b/bin/bwrap-home @@ -56,6 +56,7 @@ else bwrap_opts+=(--bind /tmp{,}) fi +orig_HOME="$HOME" if [[ $home_tmpfs ]]; then bwrap_opts+=( --tmpfs "$HOME" @@ -71,6 +72,13 @@ else ) fi +if [[ "$HOME" != "$orig_HOME" ]]; then + bwrap_opts+=( + --ro-bind {"$orig_HOME","$HOME"}/.config/mise + --ro-bind {"$orig_HOME","$HOME"}/.local/share/mise + ) +fi + (( $# )) || set -- bash o exec bwrap \