aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io.github.89luca89.distrobox/README.md6
-rw-r--r--io.github.89luca89.distrobox/io.github.89luca89.distrobox.yml30
-rw-r--r--io.github.89luca89.distrobox/podman8
3 files changed, 44 insertions, 0 deletions
diff --git a/io.github.89luca89.distrobox/README.md b/io.github.89luca89.distrobox/README.md
new file mode 100644
index 0000000..ed98e85
--- /dev/null
+++ b/io.github.89luca89.distrobox/README.md
@@ -0,0 +1,6 @@
+# distrobox
+
+this flatpak needs some more setup, the host also needs podman installed.
+
+When creating the distrobox you'll have to do it from inside the flatpak, meaning you first have to run `flatpk run --command=bash io.github.luca.distrobox` and then the usual distrobox create command, which will create the container, however once that's done you can enter the container by just running `flatpak run io.github.luca.distrobox enter ...`
+
diff --git a/io.github.89luca89.distrobox/io.github.89luca89.distrobox.yml b/io.github.89luca89.distrobox/io.github.89luca89.distrobox.yml
new file mode 100644
index 0000000..23dfba5
--- /dev/null
+++ b/io.github.89luca89.distrobox/io.github.89luca89.distrobox.yml
@@ -0,0 +1,30 @@
+app-id: io.github.luca.distrobox
+runtime: org.freedesktop.Platform
+runtime-version: '21.08'
+sdk: org.freedesktop.Sdk
+command: distrobox
+finish-args:
+ - --share=network
+ - --socket=session-bus
+ - --filesystem=home:rw
+ - --share=ipc
+ - --socket=fallback-x11 # not sure why, but gui applications only work when both x11 and fallback-x11 are allowed
+ - --socket=x11
+ - --socket=wayland
+ - --device=all
+# - --filesystem=host-etc:rw
+# - --filesystem=host-os:rw
+
+modules:
+ - name: distrobox
+ buildsystem: simple
+ sources:
+ - type: git
+ url: https://github.com/89luca89/distrobox.git
+ branch: main
+ - type: file
+ path: ./podman
+ build-commands:
+ - chmod +x install
+ - ./install --prefix /app
+ - install -Dm755 ./podman /app/bin/podman
diff --git a/io.github.89luca89.distrobox/podman b/io.github.89luca89.distrobox/podman
new file mode 100644
index 0000000..9e80f42
--- /dev/null
+++ b/io.github.89luca89.distrobox/podman
@@ -0,0 +1,8 @@
+#!/usr/bin/bash
+
+set -x
+
+command="$@"
+command=$(echo "${command}" | sed 's|podman||' | sed 's|--volume /run/host/monitor/host.conf:/etc/host.conf:ro||' | sed 's|--volume /run/host/monitor/hosts:/etc/hosts:ro||' | sed 's|--volume /run/host/monitor/resolv.conf:/etc/resolv.conf:ro||')
+
+flatpak-spawn --host podman $command