Synit: generate argv from daemon or foregroundProcess

This commit is contained in:
Emery Hemingway 2023-11-25 19:44:45 +02:00
parent 45e78c6c0b
commit 94e26ea4ab
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ lib, writeTextFile, toPreserves }:
{ name, description, daemon, daemonArgs, environment, directory
{ name, description, argv, environment, directory
# List of services that this configuration depends on.
, dependencies ? [ ]
# Daemon will not be started until all elements of depends-on are asserted.
@ -14,7 +14,7 @@ let
# map (arg: ''"${lib.replaceStrings [ ''"'' ] [ ''\"'' ] (toString arg)}"'');
processSpec = {
argv = [ daemon ] ++ daemonArgs;
inherit argv;
env = environment;
} // (lib.attrsets.optionalAttrs (directory != null) { dir = directory; });

View File

@ -6,8 +6,12 @@
let
generatedTargetSpecificArgs = {
inherit name description daemon daemonArgs environment directory
dependencies;
inherit name description environment directory dependencies;
argv = if daemon != null then
[ daemon ] ++ daemonArgs
else
[ foregroundProcess ] ++ foregroundProcessArgs;
};
targetSpecificArgs = if builtins.isFunction overrides then