diff options
| author | Martin Fischer <martin@push-f.com> | 2026-01-25 11:08:56 +0100 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-01-25 13:31:36 +0100 |
| commit | bcce1065d983a072854157085dfc028b0fcc4dd9 (patch) | |
| tree | 6b658fcca92d2a5248476609d19b07bde0513b61 | |
| parent | 1fa071ca6e6f437b0565558146ee7f92b0bdb2a8 (diff) | |
feat(workstation): add rsqlite script
| -rw-r--r-- | nixos/hosts/ev/default.nix | 5 | ||||
| -rw-r--r-- | nixos/hosts/tente/default.nix | 5 | ||||
| -rwxr-xr-x | nixos/profiles/workstation/scripts/rsqlite | 15 |
3 files changed, 25 insertions, 0 deletions
diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix index 0b8b2f3..d5737fa 100644 --- a/nixos/hosts/ev/default.nix +++ b/nixos/hosts/ev/default.nix @@ -56,6 +56,11 @@ in time.timeZone = "Europe/Vienna"; + environment.systemPackages = with pkgs; [ + # The essentials are installed via the imported profile. + sqlite-interactive + ]; + fileSystems = { "/mnt/personal" = { device = "UUID=5587670d-9a50-4068-baca-17f5360f9ff9"; diff --git a/nixos/hosts/tente/default.nix b/nixos/hosts/tente/default.nix index 2b4fafb..fe9b0a5 100644 --- a/nixos/hosts/tente/default.nix +++ b/nixos/hosts/tente/default.nix @@ -53,6 +53,11 @@ in time.timeZone = "Europe/Vienna"; + environment.systemPackages = with pkgs; [ + # The essentials are installed via the imported profile. + sqlite-interactive + ]; + users.groups = { www-generator = {}; www-personal = {}; 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'" |
