From 68e42cf9b0ca5a512500e7dc524183872b3ebaa5 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 20:36:51 +0000 Subject: populate: decide whether a target is local like isLocalTarget For specs whose target's local is null, the program decides whether the target is local like krops' lib's isLocalTarget: an empty LOGNAME or HOSTNAME counts as unset, as with lib.maybeEnv, and /etc/hostname's labels can be of any length, as with lib.types.label. is_local_with, pure, has unit tests. --- pkgs/populate/docs/design.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pkgs/populate/docs') diff --git a/pkgs/populate/docs/design.md b/pkgs/populate/docs/design.md index cc78a65..639d15b 100644 --- a/pkgs/populate/docs/design.md +++ b/pkgs/populate/docs/design.md @@ -153,9 +153,11 @@ places populate must not touch, check this after every phase. ## Execution Whether a target is local is what the target's `local` says, or, if -that's null, gets decided when the program runs: it is, if its user is -`LOGNAME` and its host is `localhost` or the host's name, from `HOSTNAME` -or `/etc/hostname`. `default.nix` decides during evaluation, like the other +that's null, gets decided when the program runs, like krops' lib's +`isLocalTarget` does: it is, if its user is `LOGNAME`, or null if that's +empty or unset, and its host is `localhost` or the host's name, from +`HOSTNAME`, or, if that's empty or unset, the only line of `/etc/hostname` +that is a label. `default.nix` decides during evaluation, like the other functions of krops. For a local target, populate runs commands directly. For a remote target, populate runs commands over ssh, sharing one master -- cgit v1.3.1