From db0ee933e845c51699dabd65cf6c0a37c7215360 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 4 Nov 2015 14:22:39 +0100 Subject: environment for generate_hostfile.hs --- custom/tinc/generate_hostfile.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'custom/tinc/generate_hostfile.hs') diff --git a/custom/tinc/generate_hostfile.hs b/custom/tinc/generate_hostfile.hs index 90fa11b7..6d4217fd 100755 --- a/custom/tinc/generate_hostfile.hs +++ b/custom/tinc/generate_hostfile.hs @@ -9,11 +9,8 @@ main = readDirectory "." >>= putStrLn . genHostFile genHostFile :: AnchoredDirTree String -> String genHostFile (_ :/ (Dir _ contents)) = "{\n" ++ entries ++ "\n}\n" where - entries = concat [ genEntry name content | (File name content) <- contents, name `notElem` hidden ] + entries = concatMap $ [genEntry name content | (File name content) <- contents] genEntry fileName fileContent = unlines . indent $ [ "\"" ++ fileName ++ "\" = ''" ] ++ indent (lines fileContent) ++ [ "'';" ] - hidden = [ "to_nix.sh" - , "hosts.nix" - ] indent :: [String] -> [String] indent = map (" " ++) -- cgit v1.2.3