about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/writers
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-04-14 17:50:16 +0000
committerAlyssa Ross <hi@alyssa.is>2019-04-14 17:50:16 +0000
commit439ebf093f2779d73bc76484a36be2889cc807bf (patch)
tree7dd3b84fb345c228165c2dae6c7cdd54b433db9e /nixpkgs/pkgs/build-support/writers
parentd7417c2c1096b13fe903af802c7cf019fca14a7b (diff)
parent0c0954781e257b8b0dc49341795a2fe7d96945a3 (diff)
downloadnixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar.gz
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar.bz2
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar.lz
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar.xz
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.tar.zst
nixlib-439ebf093f2779d73bc76484a36be2889cc807bf.zip
Merge commit '0c0954781e257b8b0dc49341795a2fe7d96945a3'
Diffstat (limited to 'nixpkgs/pkgs/build-support/writers')
-rw-r--r--nixpkgs/pkgs/build-support/writers/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/build-support/writers/default.nix b/nixpkgs/pkgs/build-support/writers/default.nix
index 6e932ce860f6..3454450c1f3a 100644
--- a/nixpkgs/pkgs/build-support/writers/default.nix
+++ b/nixpkgs/pkgs/build-support/writers/default.nix
@@ -178,6 +178,16 @@ rec {
   writeJSBin = name:
     writeJS "/bin/${name}";
 
+  writeNginxConfig = name: text: pkgs.runCommand name {
+    inherit text;
+    passAsFile = [ "text" ];
+  } /* sh */ ''
+    cp "$textPath" $out
+    ${pkgs.nginx-config-formatter}/bin/nginxfmt $out
+    ${pkgs.gnused}/bin/sed -i '/^$/d' $out
+    ${pkgs.gixy}/bin/gixy $out
+  '';
+
   # writePerl takes a name an attributeset with libraries and some perl sourcecode and
   # returns an executable
   #