summaryrefslogtreecommitdiffstats
path: root/default.nix
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 /default.nix
parent65977c6108d9517d58a6bd6ce8676c6a7b97615e (diff)
stockholm: guess current-{host,user}-name harder
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/default.nix b/default.nix
index 4a5e4ea2..656a7f4b 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: