-
Notifications
You must be signed in to change notification settings - Fork 34
DX Next #288
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
Open
jumpyvi
wants to merge
35
commits into
projectbluefin:main
Choose a base branch
from
jumpyvi:dxnext
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DX Next #288
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
e21ec3d
First version
jumpyvi 0df05a1
Fix sysusers script
jumpyvi 61fe3e1
Add links
jumpyvi d45c7f3
Add auto-updates to libvirt quadlet
jumpyvi bb35bbd
Fix bundle
jumpyvi 1663c49
Reload daemon before enabling
jumpyvi 3d9346e
Remove /etc bind mount
jumpyvi 29c9bc9
Fix formating
jumpyvi 3ba5141
Add missing path
jumpyvi 01c1836
Add missing libvirt steps
jumpyvi c75c849
Fix flatpak package name
jumpyvi 1bb7864
Add virtgl support
jumpyvi c1b1a98
make /etc/libvirt persistant on restart
jumpyvi cf455ea
Fix cask not support by linux
jumpyvi 51746d8
Remove sysprof for now
jumpyvi b083d22
Fork virt-man
jumpyvi 38161a9
Remove ydotool
jumpyvi cb0ce97
Firewall fixes
jumpyvi c7e419b
add iptables
jumpyvi cb51b10
re-add ydotool
jumpyvi 024e916
ootb incus setup
jumpyvi 8f017e7
Add acceleration support
jumpyvi da51a97
Rename everything for consistency
jumpyvi 54aca3b
Fix path typo
jumpyvi 9a82744
Rename missing quadlet
jumpyvi 1e71bfa
Use moby from upstream brew
jumpyvi b8b7db7
Modularize the whole thing
jumpyvi 1da1391
Fix flatpaks
jumpyvi 15739c2
Fix docker paths
jumpyvi f05e42e
Add incus-cli
jumpyvi 4ff964e
Swap enable for start
jumpyvi 502cdcd
Typo
jumpyvi 424de15
Switch back to custom docker cask
jumpyvi 46b4722
Fix edge case where kvm isnt owned by kvm
jumpyvi 8d0d3fb
Merge branch 'main' into dxnext
inffy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
system_files/shared/usr/share/ublue-os/dx/quadlets/cockpit-dx.container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [Unit] | ||
| Description=Cockpit Web Service | ||
| After=network-online.target | ||
| Wants=network-online.target sshd.service | ||
|
|
||
| [Container] | ||
| Image=quay.io/cockpit/ws:latest | ||
| ContainerName=cockpit-ws | ||
| Volume=/:/host:rslave | ||
| PodmanArgs=--privileged --pid=host | ||
|
|
||
| Network=host | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
26 changes: 26 additions & 0 deletions
26
system_files/shared/usr/share/ublue-os/dx/quadlets/incus-dx.container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [Unit] | ||
| Description=Incus Container Service | ||
| After=network-online.target | ||
|
|
||
| [Container] | ||
| Image=ghcr.io/cmspam/incus-docker:nightly | ||
| AutoUpdate=registry | ||
| ContainerName=incus | ||
| PodmanArgs=--privileged --cgroupns=host --security-opt unmask=/sys/fs/cgroup --pid=host | ||
| Network=host | ||
|
|
||
| # Volume mappings | ||
| Volume=/dev:/dev | ||
| Volume=/var/lib/incus:/var/lib/incus | ||
| Volume=/lib/modules:/lib/modules:ro | ||
|
|
||
| AddDevice=/dev/kvm | ||
| AddDevice=/dev/bus/usb | ||
| Mount=type=bind,source=/dev/dri,destination=/dev/dri | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
|
|
||
| [Service] | ||
| StateDirectory=incus | ||
| ExecStartPost=bash -c 'until [ -S /var/lib/incus/unix.socket ]; do sleep 0.2; done; chgrp incus-admin /var/lib/incus/unix.socket' |
34 changes: 34 additions & 0 deletions
34
system_files/shared/usr/share/ublue-os/dx/quadlets/libvirt-dx.container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| [Unit] | ||
| Description=Libvirt Service in Podman | ||
| After=network-online.target | ||
|
|
||
| [Container] | ||
| Image=ghcr.io/jumpyvi/qemu-box:latest | ||
| AutoUpdate=registry | ||
| Network=host | ||
|
|
||
| PodmanArgs=--privileged --cgroupns=host --security-opt label=disable --pid=host | ||
|
|
||
| # Dbus | ||
| Mount=type=bind,source=/var/run/dbus/system_bus_socket,destination=/run/dbus/system_bus_socket | ||
|
|
||
| # UDev | ||
| Mount=type=bind,source=/var/run/udev,destination=/run/udev,ro | ||
|
|
||
| # KVV, USB Devices and OpenGL | ||
| AddDevice=/dev/kvm | ||
| AddDevice=/dev/bus/usb | ||
| Mount=type=bind,source=/dev/dri,destination=/dev/dri | ||
| Mount=type=bind,source=/var/run/libvirt-dx,destination=/run/libvirt | ||
|
|
||
| # Storage | ||
| Mount=type=bind,source=/var/lib/libvirt-dx,destination=/var/lib/libvirt | ||
| Volume=libvirt-conf:/etc/libvirt:Z | ||
|
|
||
| Exec=sh -c "chgrp kvm /dev/kvm && virtlogd -d && libvirtd" | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
|
|
||
| [Service] | ||
| RuntimeDirectory=libvirt-dx |
26 changes: 26 additions & 0 deletions
26
system_files/shared/usr/share/ublue-os/dx/units/system/dockerd-dx.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [Unit] | ||
| Description=Docker Application Container Engine (brew) | ||
| Documentation=https://docs.docker.com/ | ||
|
|
||
| [Service] | ||
| ExecStart=/bin/bash -c "env PATH='$PATH:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin' /home/linuxbrew/.linuxbrew/bin/dockerd" | ||
| ExecReload=/bin/kill -s HUP $MAINPID | ||
|
|
||
| Type=notify | ||
| NotifyAccess=all | ||
| KillMode=mixed | ||
| Delegate=yes | ||
|
|
||
| Restart=always | ||
| RestartSec=2 | ||
| StartLimitBurst=3 | ||
| StartLimitInterval=60s | ||
|
|
||
| TimeoutSec=0 | ||
| LimitNOFILE=infinity | ||
| LimitNPROC=infinity | ||
| LimitCORE=infinity | ||
| TasksMax=infinity | ||
|
|
||
| [Install] | ||
| WantedBy=default.target | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
28 changes: 28 additions & 0 deletions
28
system_files/shared/usr/share/ublue-os/dx/units/user/dockerd-rootless-dx.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| [Unit] | ||
| Description=Docker Application Container Engine (Brew Rootless) | ||
| Documentation=https://docs.docker.com/go/rootless/ | ||
|
|
||
| [Service] | ||
| Environment=PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/bin:/usr/sbin:/bin | ||
| Environment=XDG_RUNTIME_DIR=/run/user/%U | ||
| ExecStart=/home/linuxbrew/.linuxbrew/bin/dockerd-rootless.sh --iptables=false | ||
| ExecReload=/bin/kill -s HUP $MAINPID | ||
| TimeoutSec=0 | ||
| RestartSec=2 | ||
| Restart=always | ||
| StartLimitBurst=3 | ||
| StartLimitInterval=60s | ||
| LimitNOFILE=infinity | ||
| LimitNPROC=infinity | ||
| LimitCORE=infinity | ||
| TasksMax=infinity | ||
| Delegate=yes | ||
| Type=notify | ||
| NotifyAccess=all | ||
| KillMode=mixed | ||
|
|
||
| [Install] | ||
| WantedBy=default.target | ||
|
|
||
| [Install] | ||
| WantedBy=default.target |
36 changes: 36 additions & 0 deletions
36
system_files/shared/usr/share/ublue-os/homebrew/dx-next.Brewfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| tap "ublue-os/experimental-tap" | ||
| tap "ublue-os/tap" | ||
|
|
||
|
|
||
| cask "android-platform-tools" | ||
| flatpak "org.flatpak.Builder" | ||
| brew "git-svn" | ||
| brew "git-subrepo" | ||
| brew "bpftop" | ||
| brew "numactl" | ||
| brew "p7zip" | ||
| brew "podman-compose" | ||
| brew "podman-tui" | ||
| #brew "sysprof" | ||
| brew "ublue-os/experimental-tap/ydotool" | ||
|
|
||
| # New | ||
| brew "lima" | ||
| brew "kind" | ||
| brew "incus" | ||
| brew "squashfs" | ||
| brew "devcontainer" | ||
| vscode "ms-vscode-remote.remote-containers" | ||
| flatpak "io.podman_desktop.PodmanDesktop" | ||
|
|
||
| # Wall of shame | ||
| #iotop | ||
| #bcc | ||
| #bpftrace | ||
| #fonts todo | ||
| #nicstat | ||
| #osbuild-selinux | ||
| #podman-machine | ||
| #tiptop | ||
| #udica | ||
| #util-linux-script |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| dx_justfile := "/usr/share/ublue-os/just/dx.just" | ||
|
|
||
| # Add user to all DX group with sysusers, this is always ran | ||
| dx-groups: | ||
| #!/usr/bin/env bash | ||
| current=$(groups "$USER") | ||
| missing=() | ||
| for group in libvirt docker incus-admin; do | ||
| echo "$current" | grep -qw "$group" || missing+=("$group") | ||
| done | ||
|
|
||
| if [ ${#missing[@]} -ne 0 ]; then | ||
| gum format -- "Adding $USER to: **${missing[*]}**" | ||
| sudo mkdir -p /etc/sysusers.d/ | ||
| for group in "${missing[@]}"; do echo "m $USER $group"; done | sudo tee /etc/sysusers.d/dx-groups.conf > /dev/null | ||
| sudo systemd-sysusers /etc/sysusers.d/dx-groups.conf | ||
| fi | ||
|
|
||
| # A developper's essential toolkit such as VSCode, podman-tui, etc | ||
| dx-tools: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground 212 " Installing DX-Tools & Base Apps..." | ||
| brew bundle --file=/usr/share/ublue-os/homebrew/dx-next.Brewfile | ||
| brew install --cask ublue-os/tap/visual-studio-code-linux | ||
|
|
||
| # Setup rootless and rootfull docker with brew | ||
| dx-docker: | ||
| #!/usr/bin/env bash | ||
| just -f {{dx_justfile}} dx-docker-rootless | ||
| just -f {{dx_justfile}} dx-docker-root | ||
|
|
||
|
|
||
| dx-docker-rootless: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground 212 " Setting up Rootless Docker..." | ||
|
|
||
| brew install docker | ||
| brew install --cask ublue-os/experimental-tap/dockerd-linux | ||
| mkdir -p ~/.config/systemd/user/ | ||
| cp /usr/share/ublue-os/dx/units/user/dockerd-rootless-dx.service ~/.config/systemd/user/ | ||
|
|
||
| systemctl --user daemon-reload | ||
| systemctl --user enable --now dockerd-rootless-dx | ||
|
|
||
| dx-docker-root: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground 212 " Setting up Rootfull Docker..." | ||
| sudo cp /usr/share/ublue-os/dx/units/system/dockerd-dx.service /etc/systemd/system/ | ||
| brew install --cask ublue-os/experimental-tap/dockerd-linux | ||
| brew install iptables docker | ||
| sudo systemctl daemon-reload | ||
| sudo systemctl enable --now dockerd-dx | ||
| /home/linuxbrew/.linuxbrew/bin/docker context switch default | ||
|
|
||
|
|
||
| # Setup qemu/libvirt using quadlets | ||
| dx-virt: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground 212 " Setting up Libvirt/QEMU..." | ||
| flatpak install -y org.virt_manager.virt-manager | ||
| flatpak install -y org.virt_manager.virt_manager.Extension.Qemu | ||
|
|
||
|
|
||
| SOCKET_DIR="/run/libvirt-dx" | ||
| echo 'SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="libvirt"' | sudo tee /etc/udev/rules.d/50-spice-usb.rules | ||
| sudo mkdir -p /var/lib/libvirt-dx "$SOCKET_DIR" | ||
| sudo chmod 775 "$SOCKET_DIR" | ||
|
|
||
| if ! sudo firewall-cmd --permanent --get-zones | grep -qw libvirt; then | ||
| sudo firewall-cmd --permanent --new-zone=libvirt | ||
| fi | ||
| sudo firewall-cmd --permanent --zone=libvirt --set-target=ACCEPT | ||
| sudo firewall-cmd --reload | ||
|
|
||
| sudo mkdir -p /etc/containers/systemd/ | ||
| sudo mkdir -p /var/lib/libvirt-dx/images/ | ||
| sudo cp /usr/share/ublue-os/dx/quadlets/libvirt-dx.container /etc/containers/systemd/ | ||
| sudo systemctl daemon-reload | ||
| sudo systemctl start libvirt-dx | ||
|
|
||
| flatpak override --user --filesystem=/run/libvirt-dx org.virt_manager.virt-manager | ||
| flatpak run org.virt_manager.virt-manager -c "qemu:///system?socket=/run/libvirt-dx/libvirt-sock" &>/dev/null & | ||
| flatpak run org.virt_manager.virt-manager -c "qemu:///session" &>/dev/null & | ||
|
|
||
| # Setup incus and incus-webui with quadlet | ||
| dx-incus: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground "#cc3d19" " Enabling and Starting Incus..." | ||
| brew install incus | ||
| sudo cp /usr/share/ublue-os/dx/quadlets/incus-dx.container /etc/containers/systemd/ | ||
| sudo systemctl daemon-reload | ||
| sudo systemctl start incus-dx | ||
|
|
||
| # Setup cockpit with quadlet | ||
| dx-cockpit: | ||
| #!/usr/bin/env bash | ||
| gum style --foreground "#2c77df" " Enabling and Starting Cockpit..." | ||
| sudo cp /usr/share/ublue-os/dx/quadlets/cockpit-dx.container /etc/containers/systemd/ | ||
| sudo systemctl daemon-reload | ||
| sudo systemctl start cockpit-dx |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of single quotes around
$PATHprevents the shell from expanding the variable, and sinceenvdoes not perform shell expansion, the literal string$PATHwill be prepended to the environment variable. This will likely causedockerdto fail when looking for system binaries. Usingexecis also recommended for proper process management.