#!/bin/env fish begin set -l dir (status dirname) set -l source "$dir/docker-compose.secrets.yml" source "$dir/../service.fish" function installSW -V dir -V source set -l pw (nix-shell -p keepassxc --run "keepassxc-cli generate --length 32") set -l userKey ".services.anki.environment.SYNC_USER1" set -l user (yq --raw-output "$userKey" "$source" | sed "s/:.*\$/:$pw/") initializeServiceInstallation $argv sudo cp "$dir/docker-compose.yml" (getServiceRoot $argv) USER=$user yq "$userKey = env.USER" "$source" | \ sudo tee (getServiceSecretsConfig $argv) >/dev/null installDockerService $argv end function configureSW -V dir configureDockerService $argv end function getServiceNginxConfigSource -V dir echo "$dir/anki.conf" end function getServiceConfigs printf "%s\0" "anki" "/" end runInstaller --force $argv end