Skip to content

Commit

Permalink
feat: initial pass at supporting podmansh (#412)
Browse files Browse the repository at this point in the history
Co-authored-by: Jorge O. Castro <jorge.castro@gmail.com>
  • Loading branch information
jeefy and castrojo committed Aug 15, 2023
1 parent 17b90fb commit 751a5f8
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
19 changes: 19 additions & 0 deletions usr/share/ublue-os/just/custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ nix-devbox-global:
echo 'run "devbox global run" to see other available configuration commands'

# Install better touch-friendly GNOME extensions
podmansh:
sudo mkdir -p /etc/containers/systemd/users/${UID}
sudo cp /usr/share/ublue-os/quadlets/podmansh.container /etc/containers/systemd/users/${UID}/podmansh.container
sudo lchsh $USER /usr/bin/podmansh
podman pull ghcr.io/ublue-os/ubuntu-toolbox:latest

systemctl --user daemon-reload
systemctl --user start podmansh.service
echo "Shell now switched to podmansh. Spawn a new terminal to get going!"
echo "By default, the shell will be Bash. To override it, create ~/.profile with your preferred shell"
echo "Note: That shell must exist in the toolbox!"

podmansh-switch IMAGE:
sudo sed -i "/Image\=.*$/c Image\={{IMAGE}}" /etc/containers/systemd/users/${UID}/podmansh.container
podman pull {{IMAGE}}
podman rm -f podmansh
systemctl --user daemon-reload
systemctl --user start podmansh.service
echo "Image now switched to {{IMAGE}}"
touch:
pip install --upgrade gnome-extensions-cli
gext install improvedosk@nick-shmyrev.dev
Expand Down
41 changes: 41 additions & 0 deletions usr/share/ublue-os/quadlets/podmansh.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[Unit]
Description=The Podmansh container
After=local-fs.target

[Container]
Image=ghcr.io/ublue-os/ubuntu-toolbox:latest
ContainerName=podmansh
RemapUsers=keep-id
RunInit=yes
Network=host
AddCapability=all
NoNewPrivileges=no
Exec=sleep infinity
WorkingDir=%h

Volume=%h:%h
Volume=/:/run/host:rslave
Volume=/dev:/dev:rslave
Volume=/sys:/sys:rslave
Volume=/tmp:/tmp:rslave
Volume=/sys/fs/selinux
Volume=/var/log/journal
Volume=/run/user/1000:/run/user/1000:rslave
Volume=/etc/hosts:/etc/hosts:ro
Volume=/etc/resolv.conf:/etc/resolv.conf:ro

Environment=ENV=%h/.profile

PodmanArgs=--env-host
PodmanArgs=--privileged
PodmanArgs=--mount=type=devpts,destination=/dev/pts
PodmanArgs=--userns=keep-id
PodmanArgs=--ulimit=host
PodmanArgs=--security-opt=label=disable
PodmanArgs=--cgroupns=private
PodmanArgs=--log-level=debug

Annotation=run.oci.keep_original_groups=1

[Install]
RequiredBy=default.target

0 comments on commit 751a5f8

Please sign in to comment.