summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-04-25 15:18:59 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-05-15 15:04:50 +0200
commitaea1b2037b92c06d5fe7c5a4501802a4826dc0ff (patch)
tree06c24ee73ee9580435fca563de76ec0cb0858965
parenta7dfafa890c60394c84ccca688ba7e1f1bb44c76 (diff)
Add playbook for a symlinked directory
-rw-r--r--defaults1
-rw-r--r--playbooks.d/etc-nixos/description.txt1
-rw-r--r--playbooks.d/etc-nixos/playbook.bash18
3 files changed, 20 insertions, 0 deletions
diff --git a/defaults b/defaults
index 10e0fd8..bef70c5 100644
--- a/defaults
+++ b/defaults
@@ -7,6 +7,7 @@ dns.upstream.1=188.68.231.82
dns.upstream.2=51.83.172.84
dns.upstream.3=2a03:94e0:1804::1
dns.upstream.4=2001:470:71:6dc::53
+etc-nixos.path=/etc/nixos
k3s-master.helm.repos.jetstack.url=https://charts.jetstack.io
k3s-master.helm.apps.certmanager.chart=jetstack/cert-manager
k3s-master.helm.apps.certmanager.namespace=base-system
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")"
+}