diff options
author | tv <tv@krebsco.de> | 2016-02-04 04:47:58 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-04 04:47:58 +0100 |
commit | 89d6f319d0909b127a603fd825e3a1143b14260b (patch) | |
tree | 8a65eeffad4fad8835845eed471e4a1c8232dcfb | |
parent | 65977c6108d9517d58a6bd6ce8676c6a7b97615e (diff) |
stockholm: guess current-{host,user}-name harder
-rw-r--r-- | default.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/default.nix b/default.nix index 4a5e4ea2c..656a7f4b3 100644 --- a/default.nix +++ b/default.nix @@ -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: |