Skip to content

Commit add53b9

Browse files
authored
bird: add indent (#16)
1 parent 48e0bbf commit add53b9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{ config, lib, pkgs, ... }:
22
let
33
cfg = config.services.bird;
4+
5+
indent = n: text:
6+
lib.concatMapStringsSep "\n"
7+
(line: "${lib.strings.replicate n " "}${line}")
8+
(lib.splitString "\n" text);
49
in
510
{
611
options.services.bird = {
@@ -57,7 +62,7 @@ in
5762
let
5863
mkTemplate = { name, type, conf }: ''
5964
template ${type} ${name} {
60-
${conf}
65+
${indent 2 conf}
6166
}
6267
'';
6368

@@ -70,7 +75,7 @@ in
7075

7176
mkProtocol = { name, type, conf }: ''
7277
protocol ${if type == "ospfv2" then "ospf v2" else if type == "ospfv3" then "ospf v3" else type} ${name} {
73-
${conf}
78+
${indent 2 conf}
7479
}
7580
'';
7681

0 commit comments

Comments
 (0)