diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index db1eed38d..f42828b31 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,20 @@ { - "name": "jan", - "image": "node:20" + "name": "Jan", + "image": "mcr.microsoft.com/devcontainers/base:jammy", + "features": { + "ghcr.io/devcontainers/features/node:1": { + "version": "20" + }, + "ghcr.io/devcontainers/features/rust:1": {}, + "ghcr.io/devcontainers-extra/features/corepack:1": {} + }, + + "postCreateCommand": "./.devcontainer/postCreateCommand.sh", + + // appimagekit requires fuse to package appimage, to use fuse in the container you need to enable it on the host + "runArgs": [ + "--device", "/dev/fuse", + "--cap-add=SYS_ADMIN", + "--security-opt", "apparmor:unconfined" + ] } diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 000000000..79fb4de1c --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# install tauri prerequisites + xdg-utils for xdg-open + libfuse2 for using appimagekit + +sudo apt update +sudo apt install -yqq libwebkit2gtk-4.1-dev \ + build-essential \ + curl \ + wget \ + file \ + libxdo-dev \ + libssl-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + xdg-utils \ + libfuse2 + +sudo mkdir -p /opt/bin +sudo wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /opt/bin/appimagetool +sudo chmod +x /opt/bin/appimagetool \ No newline at end of file