provide properties attr to services

properties are similar to outputs, but are different in that they are
fixed values (do not change) and are present even when the service is
down

if the attribute is present and an attrset, this will write the
equivalent recursive directory structure to $out/.properties/
This commit is contained in:
Daniel Barlow
2025-03-12 23:35:56 +00:00
parent 2b0972ed73
commit 4e51977ae0
2 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,15 @@
source $stdenv/setup
mkdir -p $out/${name}
writepath(){
mkdir -p $(dirname $1)
echo $2 > $1
}
if test -n "$propertiesText"; then
mkdir $out/.properties
( cd $out/.properties; eval "$propertiesText" )
fi
echo $serviceType > $out/${name}/type
mkdir -p $out/${name}/dependencies.d
echo $buildInputs > $out/buildInputs