From 81c4885124f8a6c316a9911a0cb4bd60caa4e674 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 8 Jun 2020 22:58:11 +0200 Subject: [PATCH] lib: add firstWord --- lib/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/default.nix b/lib/default.nix index 5829250..f1f0007 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -36,6 +36,9 @@ let { if lib.length y != 1 then throw "malformed /etc/hostname" else lib.elemAt y 0; + firstWord = s: + lib.head (lib.match "^([^[:space:]]*).*" s); + isLocalTarget = let origin = lib.mkTarget ""; in target: