summaryrefslogtreecommitdiff
path: root/playbooks.d/etc-nixos
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks.d/etc-nixos')
-rw-r--r--playbooks.d/etc-nixos/description.txt1
-rw-r--r--playbooks.d/etc-nixos/playbook.bash18
2 files changed, 19 insertions, 0 deletions
diff --git a/playbooks.d/etc-nixos/description.txt b/playbooks.d/etc-nixos/description.txt
new file mode 100644
index 0000000..8d90523
--- /dev/null
+++ b/playbooks.d/etc-nixos/description.txt
@@ -0,0 +1 @@
+A symlinked directory to keep its content synced through Bashtard
diff --git a/playbooks.d/etc-nixos/playbook.bash b/playbooks.d/etc-nixos/playbook.bash
new file mode 100644
index 0000000..3140bb3
--- /dev/null
+++ b/playbooks.d/etc-nixos/playbook.bash
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# shellcheck disable=SC2034
+
+BASHTARD_PLAYBOOK_VARS[$BASHTARD_PLAYBOOK.path]="required"
+
+playbook_add() {
+ mkdir -pv -- "$(dirname "$(config "$BASHTARD_PLAYBOOK.path")")"
+ ln -sv -- "$(playbook_path "data")" "$(config "$BASHTARD_PLAYBOOK.path")"
+}
+
+playbook_sync() {
+ :;
+}
+
+playbook_del() {
+ rm -- "$(config "$BASHTARD_PLAYBOOK.path")"
+}