From 0efa103537a6b28a884603326cac38f89ceff9f8 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 7 Jan 2018 20:26:05 +0300 Subject: Add writeYAML --- modules/apps/sproxy2.nix | 4 +++- modules/pkgs/writeYAML.nix | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 modules/pkgs/writeYAML.nix (limited to 'modules') 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" + ''; + } -- cgit v1.2.3