Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

> In case anyone runs into this bug, below is a full version I ended up
> using (user, group, environment-variables are arguments to the wrapping
> function).
>
> #:user #$user
> #:group #$group
> #:environment-variables
> (let ((pw (getpw (or #$user (getuid)))))
>   (cons* (string-append "HOME=" (passwd:dir pw))
>          (string-append "USER=" (passwd:name pw))
>          (remove (lambda (x)
>                    (or (string-prefix? "HOME=" x)
>                        (string-prefix? "USER=" x)))
>                  (or '#$environment-variables
>                      (default-environment-variables)))))

What would be nice is to provide in (shepherd support) or similar a
‘home-environment-variables’ procedure (or similar) that would add HOME=
and USER= to the given list of environment variables.

That would avoid duplication of the boilerplate above.

If you’d like to submit such a patch, it’d be welcome!

Thanks,
Ludo’.



Reply via email to