summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
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 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: