I posted this thread last week about Atuin running on UnRaid.
I tried to find a repo that provides Atuin but couldn’t find one, so I created my own.
This is the first time I’ve done something like this, so I have no idea if there are additional measures required to guarantee integrity. My script simply downloads the latest artifact from GitHub and packages it.
Anyone using UnRaid can install a package manager called un-get, and then add my repo with:
If anyone has any questions or suggestions, please reply here or send a pull request to the repo
Proof that it works:
root@groudon:/boot/config/plugins/un-get# uname -a
Linux groudon 6.12.24-Unraid #1 SMP PREEMPT_DYNAMIC Sat May 3 00:12:52 PDT 2025 x86_64 13th Gen Intel(R) Core(TM) i9-13900K GenuineIntel GNU/Linux
root@groudon:/boot/config/plugins/un-get# type atuin
atuin is hashed (/usr/bin/atuin)
root@groudon:/boot/config/plugins/un-get# un-get install atuin
Package atuin is already installed on your system! ABORT!
Don’t freak out about running as root. UnRaid only lets you connect via ssh from the root user. Nothing I can do about that.
Then, in the bash profile I do a bunch of things, most importantly, create a symlink to atuin’s config so that the connection to my local Atuin server persists.
#!/bin/bash
alias ll='ls -AFlh'
if command -v zsh >/dev/null 2>&1; then
# Define paths
ZSH_CONFIG_DIR="/boot/config/ssh/root"
ZSH_CONFIG_FILE="$ZSH_CONFIG_DIR/zshrc"
ZSH_SYMLINK="/root/.zshrc"
# Create symlink if it doesn't exist or is broken
if [[ ! -L "$ZSH_SYMLINK" ]] || [[ ! -e "$ZSH_SYMLINK" ]]; then
# Remove broken symlink or regular file if it exists
[[ -e "$ZSH_SYMLINK" || -L "$ZSH_SYMLINK" ]] && rm -f "$ZSH_SYMLINK"
# Create the symlink
if ln -sf "$ZSH_CONFIG_FILE" "$ZSH_SYMLINK" 2>/dev/null; then
echo "Created zsh config symlink: $ZSH_SYMLINK -> $ZSH_CONFIG_FILE"
else
echo "Warning: Failed to create zsh config symlink"
fi
fi
# Ensure proper permissions on the target file if it exists
if [[ -f "$ZSH_CONFIG_FILE" ]]; then
chmod 600 "$ZSH_CONFIG_FILE"
fi
fi
# Safely create .local symlink if target directory exists
LOCAL_TARGET_DIR="/boot/config/local"
LOCAL_SYMLINK="/root/.local"
# Only create symlink if target directory exists and symlink doesn't already exist
if [[ -d "$LOCAL_TARGET_DIR" ]] && [[ ! -e "$LOCAL_SYMLINK" && ! -L "$LOCAL_SYMLINK" ]]; then
if ln -sf "$LOCAL_TARGET_DIR" "$LOCAL_SYMLINK" 2>/dev/null; then
echo "Created .local symlink: $LOCAL_SYMLINK -> $LOCAL_TARGET_DIR"
else
echo "Warning: Failed to create .local symlink"
fi
elif [[ ! -d "$LOCAL_TARGET_DIR" ]]; then
echo "Info: $LOCAL_TARGET_DIR does not exist, skipping .local symlink creation"
fi
unset LOCAL_TARGET_DIR LOCAL_SYMLINK || true
# Safely create atuin config symlink
ATUIN_TARGET_FILE="/boot/config/atuin/config.toml"
ATUIN_CONFIG_DIR="/root/.config/atuin"
ATUIN_CONFIG_FILE="$ATUIN_CONFIG_DIR/config.toml"
# Check if target file exists before proceeding
if [[ -f "$ATUIN_TARGET_FILE" ]]; then
# Create ~/.config/atuin directory if it doesn't exist
if [[ ! -d "$ATUIN_CONFIG_DIR" ]]; then
if mkdir -p "$ATUIN_CONFIG_DIR" 2>/dev/null; then
echo "Created directory: $ATUIN_CONFIG_DIR"
else
echo "Warning: Failed to create directory $ATUIN_CONFIG_DIR"
fi
fi
# Check if there's a regular file at the symlink location and remove it
if [[ -f "$ATUIN_CONFIG_FILE" && ! -L "$ATUIN_CONFIG_FILE" ]]; then
if rm -f "$ATUIN_CONFIG_FILE" 2>/dev/null; then
echo "Removed existing file: $ATUIN_CONFIG_FILE"
else
echo "Warning: Failed to remove existing file $ATUIN_CONFIG_FILE"
fi
fi
# Create symlink if it doesn't exist or is broken
if [[ ! -L "$ATUIN_CONFIG_FILE" ]] || [[ ! -e "$ATUIN_CONFIG_FILE" ]]; then
if ln -sf "$ATUIN_TARGET_FILE" "$ATUIN_CONFIG_FILE" 2>/dev/null; then
echo "Created atuin config symlink: $ATUIN_CONFIG_FILE -> $ATUIN_TARGET_FILE"
else
echo "Warning: Failed to create atuin config symlink"
fi
fi
else
echo "Info: $ATUIN_TARGET_FILE does not exist, skipping atuin config symlink creation"
fi
# Clean up variables
unset ATUIN_TARGET_FILE ATUIN_CONFIG_DIR ATUIN_CONFIG_FILE
if [[ $- == *i* ]] && command -v zsh >/dev/null 2>&1; then
if [[ -z "$ZSH_VERSION" ]] && [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
# Check if .zshrc exists and is readable
if [[ -r ~/.zshrc ]]; then
# Test if zsh can load the config without errors
if timeout 2 zsh -c '. ~/.zshrc && echo "zsh config loaded successfully"' >/dev/null 2>&1; then
exec zsh
else
echo "Warning: zsh config appears corrupted, staying in bash"
fi
fi
fi
No idea if this is the best way, or even the right way, but it works
If you have any suggestions, let me know.
By the way, thanks for improving this. I took a look at your code, and it looks great! Feel free to send a pull request if you want to.