Add one-command setup via nix run

- Add flake app so setup can be run with: nix run .
- Update README with comprehensive setup guide for:
  - First computer (initial setup)
  - Additional computers (joining)
  - Mobile device pairing
  - NixOS module usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 08:21:24 -05:00
parent dfc2d45cf5
commit 521a2431c2
2 changed files with 116 additions and 5 deletions

View File

@@ -76,6 +76,54 @@
# };
# };
# One-command setup: nix run .
apps = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
setupScript = pkgs.writeShellApplication {
name = "unsbs-setup";
runtimeInputs = with pkgs; [
git
jq
age
sops
syncthing
qrencode
zbar
ffmpeg
];
text = ''
# Find the setup script
SCRIPT_DIR="''${UNSBS_DIR:-}"
if [[ -z "$SCRIPT_DIR" ]]; then
# Try current directory first
if [[ -f "./setup" ]]; then
SCRIPT_DIR="."
# Try the flake source
elif [[ -f "${self}/setup" ]]; then
SCRIPT_DIR="${self}"
else
echo "Error: Cannot find setup script"
echo "Run from the repo directory, or clone it first:"
echo " git clone https://github.com/YOUR_USERNAME/ultimate-notetaking-sync-backup-system.git"
exit 1
fi
fi
exec "$SCRIPT_DIR/setup" "$@"
'';
};
in {
default = {
type = "app";
program = "${setupScript}/bin/unsbs-setup";
};
setup = {
type = "app";
program = "${setupScript}/bin/unsbs-setup";
};
}
);
# Development shell with all tools
devShells = forAllSystems (system:
let