users/s6-rc: add symlink capabilities to my fs abstraction

This commit is contained in:
Colin 2024-03-25 14:46:43 +00:00
parent 5ecabc57bf
commit ad951ad919
1 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,14 @@ let
}
else
pkgs.emptyDirectory
else if obj ? symlink then
if obj.symlink != null then
pkgs.runCommandLocal "s6-${path}" { } ''
mkdir -p "$out/$(dirname "${path}")"
ln -s "${obj.symlink}" "$out/${path}"
''
else
pkgs.emptyDirectory
else throw "don't know how to convert fs item at path ${path} to derivation: ${obj}";
# call with an AttrSet of fs items: