Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial pass at supporting podmansh #412

Merged
merged 6 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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