summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rwxr-xr-xcustom/tinc/generate_hostfile.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/custom/tinc/generate_hostfile.hs b/custom/tinc/generate_hostfile.hs
index 6d4217fd..a781fed6 100755
--- a/custom/tinc/generate_hostfile.hs
+++ b/custom/tinc/generate_hostfile.hs
@@ -9,8 +9,10 @@ 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 = concatMap $ [genEntry name content | (File name content) <- contents] 12 entries = concat $ [genEntry name content | (File name content) <- contents, name `notElem` hidden]
13 genEntry fileName fileContent = unlines . indent $ [ "\"" ++ fileName ++ "\" = ''" ] ++ indent (lines fileContent) ++ [ "'';" ] 13 genEntry fileName fileContent = unlines . indent $ [ "\"" ++ fileName ++ "\" = ''" ] ++ indent (lines fileContent) ++ [ "'';" ]
14 hidden = [ "hosts.nix"
15 ]
14 16
15indent :: [String] -> [String] 17indent :: [String] -> [String]
16indent = map (" " ++) 18indent = map (" " ++)