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

fix(nix/modules/launcher): add wrapGAppsHook #1976

Merged
merged 8 commits into from
Mar 25, 2023
Prev Previous commit
Next Next commit
WIP: hc-launch testing
  • Loading branch information
steveej committed Mar 24, 2023
commit 33a2ae6bf55aca061a747d834f5ac85c14ebae9b
24 changes: 24 additions & 0 deletions containers/ubuntu-podman/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:22.10

ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
&& apt-get install -y sudo git \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************

# [Optional] Set the default user. Omit if you want to keep the default as root.
USER $USERNAME

WORKDIR /home/$USERNAME
26 changes: 26 additions & 0 deletions containers/ubuntu-podman/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

set -xeu

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

podman build --build-arg USERNAME="$USER" --tag ubuntu-nix "${SCRIPT_DIR}"
xhost +si:localuser:"$USER"
podman run -it --rm \
--userns keep-id \
--security-opt label=type:container_runtime_t \
-v "$XAUTHORITY":"$XAUTHORITY":ro \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
--env XAUTHORITY \
--env DISPLAY \
--env NIX_REMOTE="daemon" \
--env NIX_CONFIG="experimental-features = nix-command flakes" \
-v /nix/store:/nix/store:ro \
-v /nix/var/nix/db:/nix/var/nix/db:ro \
-v /nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro \
-v "$(readlink "$(which nix)")":/usr/bin/nix:ro \
-v "${SCRIPT_DIR}"/../..:/home/"$USER"/project \
--workdir /home/"$USER"/project \
localhost/ubuntu-nix \
bash

4 changes: 4 additions & 0 deletions scripts/test-hc-launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

# TODO: build the hc-launch-test.webhapp file from source
echo pass | nix develop .#holonix --command hc-launch --piped -n1 ./hc-launch-test.webhapp network mdns