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: add dx-specific user setup, install devcontainers/docker vscode extensions by default #745

Merged
merged 7 commits into from
Jan 1, 2024
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
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ RUN wget https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx -O /usr
# Set up services
RUN systemctl enable docker.service && \
systemctl enable podman.socket && \
systemctl enable --global bluefin-dx-user-vscode.service && \
systemctl disable pmie.service && \
systemctl disable pmlogger.service

Expand Down
21 changes: 21 additions & 0 deletions dx/usr/bin/bluefin-dx-user-vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=1
USER_SETUP_VER_FILE="$HOME/.bluefin-vscode-configured"
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
echo "User setup has already run. Exiting..."
exit 0
fi

# Setup VSCode
# Pre-install preferred VSCode Extensions
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker

# Prevent future executions
echo "Writing state file"
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
4 changes: 1 addition & 3 deletions dx/usr/etc/skel.d/.config/Code/User/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"dev.containers.dockerComposePath": "podman-compose",
"dev.containers.dockerPath": "podman",
"window.titleBarStyle": "custom",
"editor.fontFamily": "'CaskaydiaCove Nerd Font Mono', 'Droid Sans Mono', 'monospace', monospace"
"editor.fontFamily": "'CaskaydiaCove Nerd Font Mono', 'Droid Sans Mono', 'monospace', monospace",
}
14 changes: 14 additions & 0 deletions dx/usr/lib/systemd/user/bluefin-dx-user-vscode.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Run
Wants=network-online.target
After=network-online.target ublue-user-setup.service

[Service]
Type=oneshot
ExecStart=/usr/bin/bluefin-dx-vscode
Restart=on-failure
RestartSec=30
StartLimitInterval=0

[Install]
WantedBy=default.target
2 changes: 1 addition & 1 deletion usr/bin/ublue-user-setup
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ timedatectl set-ntp true

# Prevent future executions
echo "Writing state file"
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE