summaryrefslogtreecommitdiff
path: root/custom/tinc/generate_hostfile.hs
diff options
context:
space:
mode:
Diffstat (limited to 'custom/tinc/generate_hostfile.hs')
-rwxr-xr-xcustom/tinc/generate_hostfile.hs5
1 files changed, 1 insertions, 4 deletions
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
9genHostFile :: AnchoredDirTree String -> String 9genHostFile :: AnchoredDirTree String -> String
10genHostFile (_ :/ (Dir _ contents)) = "{\n" ++ entries ++ "\n}\n" 10genHostFile (_ :/ (Dir _ contents)) = "{\n" ++ entries ++ "\n}\n"
11 where 11 where
12 entries = concat [ genEntry name content | (File name content) <- contents, name `notElem` hidden ] 12 entries = concatMap $ [genEntry name content | (File name content) <- contents]
13 genEntry fileName fileContent = unlines . indent $ [ "\"" ++ fileName ++ "\" = ''" ] ++ indent (lines fileContent) ++ [ "'';" ] 13 genEntry fileName fileContent = unlines . indent $ [ "\"" ++ fileName ++ "\" = ''" ] ++ indent (lines fileContent) ++ [ "'';" ]
14 hidden = [ "to_nix.sh"
15 , "hosts.nix"
16 ]
17 14
18indent :: [String] -> [String] 15indent :: [String] -> [String]
19indent = map (" " ++) 16indent = map (" " ++)