diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-05 15:05:06 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-05 15:05:06 -0500 |
| commit | d345455cc91df176b2b1ec7d50e67967c3f18c0c (patch) | |
| tree | 42630111a87f0e7a16166e89ecb7d11e44850ed3 /lib | |
| parent | 26c2673b6923a1906c8c4cfcf70bd4c79916e417 (diff) | |
| download | home-d345455cc91df176b2b1ec7d50e67967c3f18c0c.tar.gz | |
more improvements to service management
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/default.nix | 21 |
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 + }; + } +} |