From 89d6f319d0909b127a603fd825e3a1143b14260b Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Feb 2016 04:47:58 +0100 Subject: stockholm: guess current-{host,user}-name harder --- default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'default.nix') 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: -- cgit v1.2.3