aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/default.nix b/lib/default.nix
new file mode 100644
index 0000000..1d4ffd2
--- /dev/null
+++ b/lib/default.nix
@@ -0,0 +1,21 @@
+# wip, need to look into nixpkgs.lib.extend
+{
+ # create runit backend specific turnstile service
+ mkExecutableService =
+ {
+ name,
+ command,
+ log,
+ }:
+ let
+ sh = s: "#!/bin/sh\n${s}"
+ in
+ {
+ "${name}" = {
+ run = sh ''exec chpst -e "$TURNSTILE_ENV_DIR" ${command}'';
+ log = lib.sh ''exec vlogger -t ${name}-$(id -u) -p daemon'';
+ # creating syslog but tagging with uid, might want to change this to local logging?
+ # user cant read unless in socklog group and using socklog
+ };
+ }
+}