stockholm: guess current-{host,user}-name harder

This commit is contained in:
tv 2016-02-04 04:47:58 +01:00
parent 65977c6108
commit 89d6f319d0
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,9 @@
{ current-host-name ? abort "current-host-name not defined"
, current-user-name ? builtins.getEnv "LOGNAME"
{ current-host-name ?
let v = builtins.getEnv "HOSTNAME"; in
if v != "" then v else builtins.readFile /proc/sys/kernel/hostname
, current-user-name ?
let v = builtins.getEnv "LOGNAME"; in
if v != "" then v else abort "undefined variable: LOGNAME"
, StrictHostKeyChecking ? "yes"
}@args: