aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2018-01-07 20:26:05 +0300
committerIgor Pashev <pashev.igor@gmail.com>2018-01-07 20:47:42 +0300
commit0efa103537a6b28a884603326cac38f89ceff9f8 (patch)
tree02324c4bc8f44f22fb297e2f4414787ae0639a54
parent769c61bc91a30afe129539932629a408eee1fdc3 (diff)
downloadnixsap-0efa103537a6b28a884603326cac38f89ceff9f8.tar.gz
Add writeYAML
-rw-r--r--modules/apps/sproxy2.nix4
-rw-r--r--modules/pkgs/writeYAML.nix16
2 files changed, 19 insertions, 1 deletions
diff --git a/modules/apps/sproxy2.nix b/modules/apps/sproxy2.nix
index 8616a48..0385e79 100644
--- a/modules/apps/sproxy2.nix
+++ b/modules/apps/sproxy2.nix
@@ -38,7 +38,9 @@ let
]
) (explicit cfg));
- configFile = with cfg; pkgs.writeText "sproxy.yml" ''
+ configFile = with cfg; pkgs.writeYAML "sproxy.yml" ''
+ # yamllint disable rule:empty-lines
+ # yamllint disable rule:line-length
---
${top}
diff --git a/modules/pkgs/writeYAML.nix b/modules/pkgs/writeYAML.nix
new file mode 100644
index 0000000..064ff39
--- /dev/null
+++ b/modules/pkgs/writeYAML.nix
@@ -0,0 +1,16 @@
+{ writeTextFile, pythonPackages }:
+
+let
+
+ yamllint = pythonPackages.yamllint;
+
+in
+
+name: text:
+ writeTextFile
+ {
+ inherit name text;
+ checkPhase = ''
+ ${yamllint}/bin/yamllint "$out"
+ '';
+ }