diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2018-01-07 20:26:05 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2018-01-07 20:47:42 +0300 |
commit | 0efa103537a6b28a884603326cac38f89ceff9f8 (patch) | |
tree | 02324c4bc8f44f22fb297e2f4414787ae0639a54 | |
parent | 769c61bc91a30afe129539932629a408eee1fdc3 (diff) | |
download | nixsap-0efa103537a6b28a884603326cac38f89ceff9f8.tar.gz |
Add writeYAML
-rw-r--r-- | modules/apps/sproxy2.nix | 4 | ||||
-rw-r--r-- | modules/pkgs/writeYAML.nix | 16 |
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" + ''; + } |