summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-02-04 04:47:58 +0100
committertv <tv@krebsco.de>2016-02-04 04:47:58 +0100
commit89d6f319d0909b127a603fd825e3a1143b14260b (patch)
tree8a65eeffad4fad8835845eed471e4a1c8232dcfb
parent65977c6108d9517d58a6bd6ce8676c6a7b97615e (diff)
stockholm: guess current-{host,user}-name harder
-rw-r--r--default.nix8
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: