aboutsummaryrefslogtreecommitdiff
path: root/nixos/profiles/workstation
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-01-25 11:08:56 +0100
committerMartin Fischer <martin@push-f.com>2026-01-25 18:14:41 +0100
commitc7f90f0a773a2faa3dcf9a661749d8591b276d47 (patch)
tree47bb86704f51ce5f47d6bdc0d70ca8afd9df1971 /nixos/profiles/workstation
parentc51c2b5e21893ee7fcab6608bbe49a9fc402633c (diff)
feat(workstation): add rsqlite script
Diffstat (limited to 'nixos/profiles/workstation')
-rwxr-xr-xnixos/profiles/workstation/scripts/rsqlite15
1 files changed, 15 insertions, 0 deletions
diff --git a/nixos/profiles/workstation/scripts/rsqlite b/nixos/profiles/workstation/scripts/rsqlite
new file mode 100755
index 0000000..d9dc2ae
--- /dev/null
+++ b/nixos/profiles/workstation/scripts/rsqlite
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+if [[ "$#" != 2 && "$#" != "3" ]]; then
+ echo "usage: $0 <host> <path_in_var_lib> [sql]"
+ exit 1
+fi
+
+printf -v path %q "$2"
+
+if [[ "$#" == "3" ]]; then
+ printf -v sql %q "$3"
+else
+ sql=""
+fi
+
+ssh "$1" -t "sudo su -c 'sqlite3 /var/lib/$path $sql'"