Skip to content

Commit

Permalink
env: Sunset distrobox and OCI containers
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Jan 8, 2025
1 parent ca60f6a commit 488f708
Show file tree
Hide file tree
Showing 69 changed files with 60 additions and 2,488 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/dev-alpine.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/dev-arch.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/dev-debian.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/dev-fedora.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/dev-suse.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/dev-ubuntu.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/docker.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ This repository contains my shell environment scripts and configurations. The la
* `bash/`: Files written for `bash`, mostly aimed at bootstrapping environments from the `root` user.
* `configs/`: Configuration files, such as for terminal programs, editors, and `tmux`.
* `fish/`: Files written for `fish`, my primary shell program.
* `mkosi/`: Files for use with `mkosi` to generate chroots for development, intended to be run with `systemd-nspawn`.
* `pkgbuilds/`: My collection of PKGBUILD files for Arch Linux.
* `podman/`: My collection of container build files, mainly for use with `podman`.
* `python/`: My collection of Python scripts and projects.

## Support
Expand Down
17 changes: 17 additions & 0 deletions configs/tmux/.tmux.conf.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# new window using c
unbind c
bind-key c new-window mchsh

# open ephemeral container using E
bind-key E new-window 'sd_nspawn -e'

# run commands in systemd-nspawn using r
bind-key r {
command-prompt -p "run command (systemd-nspawn):" {
new-window "sd_nspawn -r '%1'; or exec fish -l"
}
}

# split panes into systemd-nspawn container using | and -
bind-key | split-window -h mchsh
bind-key - split-window -v mchsh
26 changes: 0 additions & 26 deletions configs/tmux/.tmux.conf.dbx

This file was deleted.

17 changes: 0 additions & 17 deletions configs/tmux/.tmux.conf.nspawn

This file was deleted.

1 change: 1 addition & 0 deletions configs/tmux/.tmux.conf.nspawn
5 changes: 0 additions & 5 deletions configs/tmux/start-distrobox.fish

This file was deleted.

22 changes: 0 additions & 22 deletions configs/tmux/test-dbx.yml

This file was deleted.

16 changes: 0 additions & 16 deletions configs/tmux/test-qemu.yml

This file was deleted.

File renamed without changes.
19 changes: 2 additions & 17 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,13 @@ else
end

if in_container
# distrobox may add duplicates to PATH, clean it up :/
# https://github.com/89luca89/distrobox/issues/1145
if in_dbx
set --local --path deduplicated_path
set --local item

for item in $PATH
if not contains $item $deduplicated_path
set -a deduplicated_path $item
end
end
set --export --global --path PATH $deduplicated_path
end

# distrobox uses $USE_CBL, systemd-nspawn uses /etc/use-cbl
if test (cat /etc/use-cbl 2>/dev/null; or echo 0) -eq 1; or test "$USE_CBL" = 1
if test (cat /etc/use-cbl 2>/dev/null; or echo 0) -eq 1
for item in $CBL_QEMU_BIN $CBL_TC_BNTL $CBL_TC_LLVM
fish_add_path -gm $item
end
end

if in_nspawn; and not test -e /etc/ephemeral; and not set -q GPG_TTY
if not test -e /etc/ephemeral; and not set -q GPG_TTY
set -gx GPG_TTY $tty
gpg_key_cache
end
Expand Down
10 changes: 0 additions & 10 deletions fish/functions/_hydro_addon_nathan.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ function _hydro_addon_nathan -d "Hydro prompt customizations"
end

# Print symbol if we are in a container (like default toolbox prompt)
if in_dbx
# If CONTAINER_ID is a part of the hostname (i.e., distrobox prior to
# https://github.com/89luca89/distrobox/commit/d626559baaa4e6ccb35b3bb0befc9d46b7aa837e),
# just show a symbol to know we are in a distrobox.
if string match -qr ^$CONTAINER_ID $hostname
set container_str §
else
set container_str "($CONTAINER_ID)"
end
end
if in_nspawn
if set incoming (findmnt -n -o FSROOT /run/host/incoming | sort -u)
set container_str '('(string split -f 2 -m 1 -r / $incoming)')'
Expand Down
Loading

0 comments on commit 488f708

Please sign in to comment.