modules/users: allow readiness.pathExists
This commit is contained in:
parent
36ea5b53ad
commit
8008fd35cb
|
@ -66,12 +66,24 @@ let
|
||||||
only once the name is registered will the service be considered "ready".
|
only once the name is registered will the service be considered "ready".
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
readiness.waitExists = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
path to a directory or file whose existence signals the service's readiness.
|
||||||
|
this is expanded as a shell expression, and may contain variables like `$HOME`, etc.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
readiness.waitCommand = lib.mkIf
|
readiness.waitCommand = lib.mkMerge [
|
||||||
(config.readiness.waitDbus != null)
|
(lib.mkIf (config.readiness.waitDbus != null)
|
||||||
''${pkgs.systemdMinimal}/bin/busctl --user status "${config.readiness.waitDbus}" > /dev/null''
|
''${pkgs.systemdMinimal}/bin/busctl --user status "${config.readiness.waitDbus}" > /dev/null''
|
||||||
;
|
)
|
||||||
|
(lib.mkIf (config.readiness.waitExists != null)
|
||||||
|
''test -e ${config.readiness.waitExists}''
|
||||||
|
)
|
||||||
|
];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
userOptions = {
|
userOptions = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user