Repository: nix-community/nixpkgs-fmt
Pull request #250 (2021-05-19 08:56:50)

Let idempotent
there are changes in the test_data to match the output. Please bear in mind that we calculate the format based on the input.


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index ba909a9..1dba1de 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,12 +1,10 @@
 # This file is automatically @generated by Cargo.
 # It is not intended for manual editing.
-version = 3
-
 [[package]]
 name = "aho-corasick"
-version = "0.7.18"
+version = "0.7.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
+checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
 dependencies = [
  "memchr",
 ]
@@ -33,9 +31,9 @@ dependencies = [
 
 [[package]]
 name = "autocfg"
-version = "1.0.1"
+version = "1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
 
 [[package]]
 name = "bitflags"
@@ -45,18 +43,18 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
 
 [[package]]
 name = "bstr"
-version = "0.2.16"
+version = "0.2.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
+checksum = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41"
 dependencies = [
  "memchr",
 ]
 
 [[package]]
 name = "bumpalo"
-version = "3.6.1"
+version = "3.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe"
+checksum = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742"
 
 [[package]]
 name = "cbitset"
@@ -73,17 +71,11 @@ version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
 
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
 [[package]]
 name = "clap"
-version = "2.33.3"
+version = "2.33.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
+checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
 dependencies = [
  "ansi_term",
  "atty",
@@ -100,7 +92,7 @@ version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if",
  "wasm-bindgen",
 ]
 
@@ -119,24 +111,34 @@ dependencies = [
  "crossbeam-utils 0.6.6",
 ]
 
+[[package]]
+name = "crossbeam-channel"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061"
+dependencies = [
+ "crossbeam-utils 0.7.2",
+ "maybe-uninit",
+]
+
 [[package]]
 name = "crossbeam-utils"
 version = "0.6.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if",
  "lazy_static",
 ]
 
 [[package]]
 name = "crossbeam-utils"
-version = "0.8.4"
+version = "0.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278"
+checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
 dependencies = [
  "autocfg",
- "cfg-if 1.0.0",
+ "cfg-if",
  "lazy_static",
 ]
 
@@ -148,15 +150,15 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
 
 [[package]]
 name = "fnv"
-version = "1.0.7"
+version = "1.0.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
+checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
 
 [[package]]
 name = "globset"
-version = "0.4.6"
+version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a"
+checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120"
 dependencies = [
  "aho-corasick",
  "bstr",
@@ -173,20 +175,21 @@ checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
 
 [[package]]
 name = "hermit-abi"
-version = "0.1.18"
+version = "0.1.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
+checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8"
 dependencies = [
  "libc",
 ]
 
 [[package]]
 name = "ignore"
-version = "0.4.17"
+version = "0.4.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b287fb45c60bb826a0dc68ff08742b9d88a2fea13d6e0c286b3172065aaf878c"
+checksum = "d692f1fdb7a67fad17cb4d3dbe3fc9c4d50d3113349251678db987b225ccabba"
 dependencies = [
- "crossbeam-utils 0.8.4",
+ "crossbeam-channel 0.4.2",
+ "crossbeam-utils 0.7.2",
  "globset",
  "lazy_static",
  "log",
@@ -200,9 +203,9 @@ dependencies = [
 
 [[package]]
 name = "itoa"
-version = "0.4.7"
+version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
+checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e"
 
 [[package]]
 name = "lazy_static"
@@ -212,30 +215,36 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
 
 [[package]]
 name = "libc"
-version = "0.2.94"
+version = "0.2.68"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
+checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
 
 [[package]]
 name = "log"
-version = "0.4.14"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
+checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
 dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
 ]
 
+[[package]]
+name = "maybe-uninit"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
+
 [[package]]
 name = "memchr"
-version = "2.4.0"
+version = "2.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
+checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
 
 [[package]]
 name = "memoffset"
-version = "0.6.3"
+version = "0.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d"
+checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87"
 dependencies = [
  "autocfg",
 ]
@@ -251,7 +260,7 @@ name = "nixpkgs-fmt"
 version = "1.2.0"
 dependencies = [
  "clap",
- "crossbeam-channel",
+ "crossbeam-channel 0.3.9",
  "ignore",
  "rnix",
  "rowan",
@@ -273,53 +282,48 @@ dependencies = [
 
 [[package]]
 name = "num-traits"
-version = "0.2.14"
+version = "0.2.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
+checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
 dependencies = [
  "autocfg",
 ]
 
-[[package]]
-name = "once_cell"
-version = "1.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3"
-
 [[package]]
 name = "proc-macro2"
-version = "1.0.26"
+version = "1.0.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
+checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435"
 dependencies = [
  "unicode-xid",
 ]
 
 [[package]]
 name = "quote"
-version = "1.0.9"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
+checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
 dependencies = [
  "proc-macro2",
 ]
 
 [[package]]
 name = "regex"
-version = "1.5.4"
+version = "1.3.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
+checksum = "8900ebc1363efa7ea1c399ccc32daed870b4002651e0bed86e72d501ebbe0048"
 dependencies = [
  "aho-corasick",
  "memchr",
  "regex-syntax",
+ "thread_local",
 ]
 
 [[package]]
 name = "regex-syntax"
-version = "0.6.25"
+version = "0.6.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
+checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
 
 [[package]]
 name = "rnix"
@@ -334,9 +338,8 @@ dependencies = [
 
 [[package]]
 name = "rowan"
-version = "0.12.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1b36e449f3702f3b0c821411db1cbdf30fb451726a9456dce5dabcd44420043"
+version = "0.12.5"
+source = "git+https://github.com/rust-analyzer/rowan#109885a86b7a095f637927944003add60d2f7ef3"
 dependencies = [
  "countme",
  "hashbrown",
@@ -354,9 +357,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
 
 [[package]]
 name = "ryu"
-version = "1.0.5"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+checksum = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76"
 
 [[package]]
 name = "same-file"
@@ -369,15 +372,15 @@ dependencies = [
 
 [[package]]
 name = "serde"
-version = "1.0.126"
+version = "1.0.105"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03"
+checksum = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff"
 
 [[package]]
 name = "serde_json"
-version = "1.0.64"
+version = "1.0.48"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
+checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25"
 dependencies = [
  "itoa",
  "ryu",
@@ -398,9 +401,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
 
 [[package]]
 name = "syn"
-version = "1.0.72"
+version = "1.0.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
+checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -427,42 +430,42 @@ dependencies = [
 
 [[package]]
 name = "thread_local"
-version = "1.1.3"
+version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"
+checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
 dependencies = [
- "once_cell",
+ "lazy_static",
 ]
 
 [[package]]
 name = "unicode-width"
-version = "0.1.8"
+version = "0.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
+checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
 
 [[package]]
 name = "unicode-xid"
-version = "0.2.2"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
+checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
 
 [[package]]
 name = "unindent"
-version = "0.1.7"
+version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f14ee04d9415b52b3aeab06258a3f07093182b88ba0f9b8d203f211a7a7d41c7"
+checksum = "63f18aa3b0e35fed5a0048f029558b1518095ffe2a0a31fb87c93dece93a4993"
 
 [[package]]
 name = "vec_map"
-version = "0.8.2"
+version = "0.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
+checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
 
 [[package]]
 name = "walkdir"
-version = "2.3.2"
+version = "2.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
+checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
 dependencies = [
  "same-file",
  "winapi",
@@ -471,19 +474,19 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.74"
+version = "0.2.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd"
+checksum = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d"
 dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
  "wasm-bindgen-macro",
 ]
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.74"
+version = "0.2.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900"
+checksum = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8"
 dependencies = [
  "bumpalo",
  "lazy_static",
@@ -496,9 +499,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.74"
+version = "0.2.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4"
+checksum = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -506,9 +509,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.74"
+version = "0.2.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97"
+checksum = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -519,9 +522,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.74"
+version = "0.2.59"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f"
+checksum = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8"
 
 [[package]]
 name = "wee_alloc"
@@ -529,7 +532,7 @@ version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e"
 dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if",
  "libc",
  "memory_units",
  "winapi",
@@ -537,9 +540,9 @@ dependencies = [
 
 [[package]]
 name = "winapi"
-version = "0.3.9"
+version = "0.3.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
 dependencies = [
  "winapi-i686-pc-windows-gnu",
  "winapi-x86_64-pc-windows-gnu",
@@ -553,9 +556,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
 
 [[package]]
 name = "winapi-util"
-version = "0.1.5"
+version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80"
 dependencies = [
  "winapi",
 ]
diff --git a/Cargo.toml b/Cargo.toml
index 69ee3bd..d4ef9a3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,8 +28,11 @@ clap = "2.33.0"
 serde_json = "1.0"
 
 [dependencies.rowan]
-version = "0.12.6"
+version = "0.12.5"
 features = [ "serde1" ]
 
 [dev-dependencies]
 unindent = "0.1.3"
+
+[patch.crates-io]
+rowan = { git = "https://github.com/rust-analyzer/rowan" }
diff --git a/README.md b/README.md
index 71bf6b9..a172d5a 100644
--- a/README.md
+++ b/README.md
@@ -113,7 +113,7 @@ nixpkgs-fmt is available in nixpkgs master. `nix-env -i nixpkgs-fmt`.
 
 It's also possible to install it directly from this repository:
 
-`nix-env -f https://github.com/nix-community/nixpkgs-fmt/archive/master.tar.gz -iA nixpkgs-fmt`
+`nix-env -f https://github.com/nix-community/nixpkgs-fmt/archive/master.tar.gz -i`
 
 ### pre-commit hook
 
diff --git a/default.nix b/default.nix
index 20877ed..b600a15 100644
--- a/default.nix
+++ b/default.nix
@@ -1,72 +1,11 @@
-{ system ? builtins.currentSystem
-, inputs ? import ./flake.lock.nix { }
-}:
+{ system ? builtins.currentSystem }:
 let
-  nixpkgs = import inputs.nixpkgs {
-    inherit system;
-    config = { };
-    overlays = [
-      (import inputs.fenix)
-    ];
+  flake-compat = builtins.fetchurl {
+    url = "https://raw.githubusercontent.com/edolstra/flake-compat/99f1c2157fba4bfe6211a321fd0ee43199025dbf/default.nix";
+    sha256 = "1vas5z58901gavy5d53n1ima482yvly405jp9l8g07nr4abmzsyb";
   };
-
-  rustToolchain = with nixpkgs.fenix;
-    combine [
-      minimal.rustc
-      minimal.cargo
-      targets."wasm32-unknown-unknown".latest.rust-std
-    ];
-
-  naersk = nixpkgs.callPackage inputs.naersk {
-    cargo = rustToolchain;
-    rustc = rustToolchain;
-  };
-
-  # This is a magic shell that can be both built and loaded as a nix-shell.
-  mkShell = { name ? "shell", packages ? [ ], shellHook ? "" }:
-    let
-      drv = nixpkgs.buildEnv {
-        inherit name;
-        # TODO: also add the shellHook as an activation script?
-        paths = packages;
-      };
-    in
-    drv.overrideAttrs (old: {
-      nativeBuildInputs = old.nativeBuildInputs ++ packages;
-      inherit shellHook;
-    });
-
 in
-rec {
-  inherit nixpkgs;
-
-  nixpkgs-fmt = naersk.buildPackage {
-    src = ./.;
-    root = ./.;
-    cratePaths = [ "." ];
-  };
-
-  # This used to be the output when we were using flake-compat.
-  defaultNix = nixpkgs-fmt;
-
-  devShell = mkShell {
-    packages = [
-      nixpkgs.cargo-fuzz
-      nixpkgs.gitAndTools.git-extras
-      nixpkgs.gitAndTools.pre-commit
-      nixpkgs.mdsh
-      nixpkgs.openssl
-      nixpkgs.pkgconfig
-      nixpkgs.wasm-pack
-      rustToolchain
-    ]
-    ++ nixpkgs.lib.optionals nixpkgs.stdenv.isDarwin [
-      nixpkgs.darwin.apple_sdk.frameworks.Security
-    ]
-    ;
-
-    shellHook = ''
-      export PATH=$PWD/target/debug:$PATH
-    '';
-  };
+import flake-compat {
+  src = ./.;
+  inherit system;
 }
diff --git a/flake.lock b/flake.lock
index e6b9757..ca8d249 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,56 +1,46 @@
 {
   "nodes": {
-    "fenix": {
-      "inputs": {
-        "naersk": [
-          "naersk"
-        ],
-        "nixpkgs": [
-          "nixpkgs"
-        ],
-        "rust-analyzer-src": "rust-analyzer-src"
-      },
+    "flake-utils": {
       "locked": {
-        "lastModified": 1621046791,
-        "narHash": "sha256-kSyaZCo2aECwS3c7eXhknXvR+XQigjxBlaRYhfVH2uc=",
-        "owner": "nix-community",
-        "repo": "fenix",
-        "rev": "fffd864ad08ed95fcb66554513fa07a5f3d626b5",
+        "lastModified": 1605370193,
+        "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "5021eac20303a61fafe17224c087f5519baed54d",
         "type": "github"
       },
       "original": {
-        "owner": "nix-community",
-        "repo": "fenix",
+        "owner": "numtide",
+        "repo": "flake-utils",
         "type": "github"
       }
     },
-    "flake-utils": {
+    "mozilla": {
+      "flake": false,
       "locked": {
-        "lastModified": 1620759905,
-        "narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8",
+        "lastModified": 1603906276,
+        "narHash": "sha256-RsNPnEKd7BcogwkqhaV5kI/HuNC4flH/OQCC/4W5y/8=",
+        "owner": "mozilla",
+        "repo": "nixpkgs-mozilla",
+        "rev": "8c007b60731c07dd7a052cce508de3bb1ae849b4",
         "type": "github"
       },
       "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
+        "owner": "mozilla",
+        "repo": "nixpkgs-mozilla",
         "type": "github"
       }
     },
     "naersk": {
       "inputs": {
-        "nixpkgs": [
-          "nixpkgs"
-        ]
+        "nixpkgs": "nixpkgs"
       },
       "locked": {
-        "lastModified": 1620316130,
-        "narHash": "sha256-sU0VS5oJS1FsHsZsLELAXc7G2eIelVuucRw+q5B1x9k=",
+        "lastModified": 1606738605,
+        "narHash": "sha256-QPg4eCZts6cn9GkeIKhrtIt6b100BzIY1sfcqniZQZk=",
         "owner": "nmattia",
         "repo": "naersk",
-        "rev": "a3f40fe42cc6d267ff7518fa3199e99ff1444ac4",
+        "rev": "8d562105f960c487cfc013c0e666c1951b03d392",
         "type": "github"
       },
       "original": {
@@ -61,11 +51,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1621083049,
-        "narHash": "sha256-b7Uva507+uEIDWbjtwRKuJ2YenuWTdYtHemjMUu2eRU=",
+        "lastModified": 1606772528,
+        "narHash": "sha256-q54ELh1LAAebwldh8vFWTOMQCMo6PPl2C4dL5FmsVY8=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "10a4520ec4730ee98227edff2d5f1fb6030dadf1",
+        "rev": "7714edc2e5001b4d0128de93df723cc1d27b2842",
         "type": "github"
       },
       "original": {
@@ -73,29 +63,26 @@
         "type": "indirect"
       }
     },
-    "root": {
-      "inputs": {
-        "fenix": "fenix",
-        "flake-utils": "flake-utils",
-        "naersk": "naersk",
-        "nixpkgs": "nixpkgs"
-      }
-    },
-    "rust-analyzer-src": {
-      "flake": false,
+    "nixpkgs_2": {
       "locked": {
-        "lastModified": 1621033839,
-        "narHash": "sha256-QLKsmo7toh3VNW4H6Sng4m8tG2xXBQhS6fW2ZPtpOgc=",
-        "owner": "rust-analyzer",
-        "repo": "rust-analyzer",
-        "rev": "87ef340c19ae5ac73fc9b1cd37909d9d8ad53d09",
+        "lastModified": 1606772528,
+        "narHash": "sha256-q54ELh1LAAebwldh8vFWTOMQCMo6PPl2C4dL5FmsVY8=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "7714edc2e5001b4d0128de93df723cc1d27b2842",
         "type": "github"
       },
       "original": {
-        "owner": "rust-analyzer",
-        "ref": "nightly",
-        "repo": "rust-analyzer",
-        "type": "github"
+        "id": "nixpkgs",
+        "type": "indirect"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "mozilla": "mozilla",
+        "naersk": "naersk",
+        "nixpkgs": "nixpkgs_2"
       }
     }
   },
diff --git a/flake.lock.nix b/flake.lock.nix
deleted file mode 100644
index 1e4e41c..0000000
--- a/flake.lock.nix
+++ /dev/null
@@ -1,105 +0,0 @@
-# Adapted from https://github.com/edolstra/flake-compat/blob/master/default.nix
-#
-# This version only gives back the inputs. In that mode, flake becomes little
-# more than a niv replacement.
-{ src ? ./. }:
-let
-  lockFilePath = src + "/flake.lock";
-
-  lockFile = builtins.fromJSON (builtins.readFile lockFilePath);
-
-  # Emulate builtins.fetchTree
-  #
-  # TODO: only implement polyfill if the builtin doesn't exist?
-  fetchTree =
-    info:
-    if info.type == "github" then
-      {
-        outPath = fetchTarball "https://api.${info.host or "github.com"}/repos/${info.owner}/${info.repo}/tarball/${info.rev}";
-        rev = info.rev;
-        shortRev = builtins.substring 0 7 info.rev;
-        lastModified = info.lastModified;
-        narHash = info.narHash;
-      }
-    else if info.type == "git" then
-      {
-        outPath =
-          builtins.fetchGit
-            ({ url = info.url; }
-            // (if info ? rev then { inherit (info) rev; } else { })
-            // (if info ? ref then { inherit (info) ref; } else { })
-            );
-        lastModified = info.lastModified;
-        narHash = info.narHash;
-      } // (if info ? rev then {
-        rev = info.rev;
-        shortRev = builtins.substring 0 7 info.rev;
-      } else { })
-    else if info.type == "path" then
-      {
-        outPath = builtins.path { path = info.path; };
-        narHash = info.narHash;
-      }
-    else if info.type == "tarball" then
-      {
-        outPath = fetchTarball info.url;
-        narHash = info.narHash;
-      }
-    else if info.type == "gitlab" then
-      {
-        inherit (info) rev narHash lastModified;
-        outPath = fetchTarball "https://${info.host or "gitlab.com"}/api/v4/projects/${info.owner}%2F${info.repo}/repository/archive.tar.gz?sha=${info.rev}";
-        shortRev = builtins.substring 0 7 info.rev;
-      }
-    else
-    # FIXME: add Mercurial, tarball inputs.
-      throw "flake input has unsupported input type '${info.type}'";
-
-  allNodes =
-    builtins.mapAttrs
-      (key: node:
-        let
-          sourceInfo =
-            if key == lockFile.root
-            then { }
-            else fetchTree (node.info or { } // removeAttrs node.locked [ "dir" ]);
-
-          inputs = builtins.mapAttrs
-            (inputName: inputSpec: allNodes.${resolveInput inputSpec})
-            (node.inputs or { });
-
-          # Resolve a input spec into a node name. An input spec is
-          # either a node name, or a 'follows' path from the root
-          # node.
-          resolveInput = inputSpec:
-            if builtins.isList inputSpec
-            then getInputByPath lockFile.root inputSpec
-            else inputSpec;
-
-          # Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the
-          # root node, returning the final node.
-          getInputByPath = nodeName: path:
-            if path == [ ]
-            then nodeName
-            else
-              getInputByPath
-                # Since this could be a 'follows' input, call resolveInput.
-                (resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path})
-                (builtins.tail path);
-
-          result = sourceInfo // { inherit inputs; inherit sourceInfo; };
-        in
-        if node.flake or true then
-          result
-        else
-          sourceInfo
-      )
-      lockFile.nodes;
-
-  result =
-    if lockFile.version >= 5 && lockFile.version <= 7
-    then allNodes.${lockFile.root}.inputs
-    else throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}";
-
-in
-result
diff --git a/flake.nix b/flake.nix
index 3390ae2..7b90c1f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,19 +2,75 @@
   description = "nixpkgs-fmt";
 
   inputs.flake-utils.url = "github:numtide/flake-utils";
+  inputs.mozilla = { url = "github:mozilla/nixpkgs-mozilla"; flake = false; };
   inputs.naersk.url = "github:nmattia/naersk";
-  inputs.naersk.inputs.nixpkgs.follows = "nixpkgs";
-  inputs.fenix.url = "github:nix-community/fenix";
-  inputs.fenix.inputs.naersk.follows = "naersk";
-  inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
-
-  outputs = { self, nixpkgs, naersk, fenix, flake-utils }@inputs:
-    flake-utils.lib.eachDefaultSystem (system:
-      let pkgs = import ./. { inherit system inputs; }; in
-      {
-        defaultPackage = pkgs.nixpkgs-fmt;
-        legacyPackages = pkgs;
-        devShell = pkgs.devShell;
-      }
-    );
+
+  outputs = { self, mozilla, nixpkgs, naersk, flake-utils }:
+    flake-utils.lib.simpleFlake {
+      inherit self nixpkgs;
+
+      name = "nixpkgs-fmt";
+
+      systems = flake-utils.lib.defaultSystems;
+
+      preOverlays = [
+        (import "${mozilla}/lib-overlay.nix")
+        (import "${mozilla}/rust-overlay.nix")
+        naersk.overlay
+      ];
+
+      overlay = final: prev: {
+        nixpkgs-fmt = rec {
+          nixpkgs-fmt = final.naersk.buildPackage {
+            src = self;
+            root = self;
+            cratePaths = [ "." ];
+          };
+          defaultPackage = nixpkgs-fmt;
+        };
+      };
+
+      shell = { pkgs }:
+        let
+          inherit (pkgs) lib stdenv darwin;
+
+          rustChan = pkgs.rustChannelOf {
+            date = "2020-12-29";
+            channel = "nightly";
+            sha256 = "sha256-HEBBUpbIgjbluKyT1oKU/KvQFOBFPML9vuAHuXuhoYA=";
+          };
+
+          rust = rustChan.rust.override {
+            extensions = [
+              "clippy-preview"
+              "rls-preview"
+              "rustfmt-preview"
+              "rust-analysis"
+              "rust-std"
+              "rust-src"
+            ];
+            targets = [ "wasm32-unknown-unknown" ];
+          };
+        in
+        pkgs.mkShell {
+          buildInputs = [
+            pkgs.cargo-fuzz
+            pkgs.gitAndTools.git-extras
+            pkgs.gitAndTools.pre-commit
+            pkgs.mdsh
+            pkgs.openssl
+            pkgs.pkgconfig
+            pkgs.wasm-pack
+            rust
+          ]
+          ++ lib.optionals stdenv.isDarwin [
+            darwin.apple_sdk.frameworks.Security
+          ]
+          ;
+
+          shellHook = ''
+            export PATH=$PWD/target/debug:$PATH
+          '';
+        };
+    };
 }
diff --git a/shell.nix b/shell.nix
index 01d7b61..1302860 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,2 +1,2 @@
 { system ? builtins.currentSystem }:
-(import ./. { inherit system; }).devShell
+(import ./. { inherit system; }).shellNix
diff --git a/src/engine/fixes.rs b/src/engine/fixes.rs
index b699530..e876098 100644
--- a/src/engine/fixes.rs
+++ b/src/engine/fixes.rs
@@ -5,7 +5,6 @@ use rnix::{
     SyntaxKind::{NODE_STRING, TOKEN_COMMENT, TOKEN_STRING_CONTENT, TOKEN_WHITESPACE},
     SyntaxNode, SyntaxToken, TextRange, TextSize,
 };
-use smol_str::SmolStr;
 
 use super::indentation::single_line_comment_indent;
 use crate::{
diff --git a/src/engine/indentation.rs b/src/engine/indentation.rs
index 2eda9da..b02c592 100644
--- a/src/engine/indentation.rs
+++ b/src/engine/indentation.rs
@@ -4,7 +4,6 @@ use std::{
 };
 
 use rnix::{SyntaxElement, SyntaxKind::*, SyntaxNode, SyntaxToken, TextSize};
-use serde_json::from_str;
 use smol_str::SmolStr;
 
 use crate::{
diff --git a/src/rules.rs b/src/rules.rs
index a4facc2..51bb96d 100644
--- a/src/rules.rs
+++ b/src/rules.rs
@@ -1,6 +1,6 @@
 //! This module contains specific `super::dsl` rules for formatting nix language.
 use rnix::{
-    types::{Lambda, TypedNode, With},
+    types::{Lambda, LetIn, TypedNode, With},
     NodeOrToken, SyntaxElement, SyntaxKind,
     SyntaxKind::*,
     T,
@@ -10,9 +10,8 @@ use crate::{
     dsl::{self, IndentDsl, IndentValue::*, SpacingDsl},
     pattern::p,
     tree_utils::{
-        has_newline, next_non_whitespace_sibling, next_sibling, next_token_sibling,
-        not_on_top_level, on_top_level, prev_non_whitespace_sibling, prev_sibling,
-        prev_token_sibling,
+        has_newline, next_non_whitespace_sibling, next_sibling, not_on_top_level, on_top_level,
+        prev_non_whitespace_sibling, prev_sibling, prev_token_sibling,
     },
 };
 
@@ -105,9 +104,9 @@ pub(crate) fn spacing() -> SpacingDsl {
         .test("let   foo = bar;in  92", "let foo = bar; in 92")
         .inside(NODE_LET_IN).after(T![let]).single_space_or_optional_newline()
         .inside(NODE_LET_IN).around(T![in]).single_space_or_optional_newline()
-        .inside(NODE_LET_IN).before(T![in]).when(header_has_multi_value).when(before_token_not_newline).newline()
-        .inside(NODE_LET_IN).after(T![in]).when(in_body_newline).newline()
-        .inside(NODE_LET_IN).before(NODE_KEY_VALUE).when(header_has_multi_value).when(before_token_not_newline).newline()
+        .inside(NODE_LET_IN).after(NODE_KEY_VALUE).single_space_or_optional_newline()
+        .inside(NODE_LET_IN).before(NODE_KEY_VALUE).when(let_header_has_newline).newline()
+        .inside(NODE_LET_IN).around(T![in]).when(let_header_has_newline).newline()
 
         .test("{a?3}: a", "{ a ? 3 }: a")
         .inside(NODE_PAT_ENTRY).around(T![?]).single_space()
@@ -121,6 +120,7 @@ pub(crate) fn spacing() -> SpacingDsl {
         .inside(NODE_IF_ELSE).around([T![else],T![then]]).single_space_or_optional_newline()
         .inside(NODE_IF_ELSE).after(T![then]).when(has_expression_node).single_space_or_newline()
         .inside(NODE_IF_ELSE).after(T![else]).when(has_expression_node).single_space_or_newline()
+        
         // special-case to force a linebreak before `=` in
         //
         // ```nix
@@ -133,7 +133,7 @@ pub(crate) fn spacing() -> SpacingDsl {
         // ```
         .add_rule(dsl::SpacingRule {
             name: None,
-            pattern: p(T![=]) & p(next_sibling_is_multiline_lambda_pattern),
+            pattern: p(T![=]) & (p(next_sibling_is_multiline_lambda_pattern) | p(next_sibling_is_multiline_letin_pattern)) ,
             space: dsl::Space { loc: dsl::SpaceLoc::After, value: dsl::SpaceValue::Newline }
         })
 
@@ -150,11 +150,6 @@ pub(crate) fn spacing() -> SpacingDsl {
             space: dsl::Space { loc: dsl::SpaceLoc::After, value: dsl::SpaceValue::Newline }
         })
 
-        .add_rule(dsl::SpacingRule {
-            name: None,
-            pattern: p(T![let]) & p(after_let_newline),
-            space: dsl::Space { loc: dsl::SpaceLoc::After, value: dsl::SpaceValue::Newline }
-        })
         ;
 
     dsl
@@ -311,10 +306,6 @@ fn before_token_has_newline(element: &SyntaxElement) -> bool {
     prev_token_sibling(element).map(|e| e.text().contains("\n")).unwrap_or(false)
 }
 
-fn before_token_not_newline(element: &SyntaxElement) -> bool {
-    !before_token_has_newline(element)
-}
-
 fn next_sibling_is_multiline_lambda_pattern(element: &SyntaxElement) -> bool {
     fn find(element: &SyntaxElement) -> Option<bool> {
         let lambda = next_non_whitespace_sibling(element)?.into_node().and_then(Lambda::cast)?;
@@ -324,19 +315,24 @@ fn next_sibling_is_multiline_lambda_pattern(element: &SyntaxElement) -> bool {
     find(element) == Some(true)
 }
 
-fn header_has_multi_value(element: &SyntaxElement) -> bool {
-    let key_value = element.parent().map(|e| {
-        e.children().fold(0, |mut v, e| {
-            if e.kind() == NODE_KEY_VALUE {
-                v += 1;
-                return v;
-            } else {
-                v += 0;
-                return v;
-            }
-        })
-    });
-    key_value.map(|e| e >= 2).unwrap_or(false)
+fn next_sibling_is_multiline_letin_pattern(element: &SyntaxElement) -> bool {
+    fn find(element: &SyntaxElement) -> Option<bool> {
+        let letin = next_non_whitespace_sibling(element)?.into_node().and_then(LetIn::cast)?;
+        let header = letin
+            .node()
+            .children_with_tokens()
+            .into_iter()
+            .take_while(|x| match x {
+                NodeOrToken::Node(_) => true,
+                NodeOrToken::Token(token) => token.kind() != TOKEN_IN,
+            })
+            .any(|child| match child {
+                NodeOrToken::Node(node) => has_newline(&node),
+                NodeOrToken::Token(token) => token.text().contains("\n"),
+            });
+        Some(header)
+    }
+    find(element) == Some(true)
 }
 
 fn inline_let_in(element: &SyntaxElement) -> bool {
@@ -350,23 +346,29 @@ fn inline_let_in(element: &SyntaxElement) -> bool {
         .unwrap_or(false)
 }
 
-// special-cased to force a linebreak after `let` when `in` is not inline and key value >= 2
-fn after_let_newline(element: &SyntaxElement) -> bool {
-    header_has_multi_value(element)
-}
-
-fn in_body_newline(element: &SyntaxElement) -> bool {
-    fn body_has_newline(element: &SyntaxElement) -> Option<bool> {
-        next_non_whitespace_sibling(element)?.as_node().map(|e| has_newline(e))
-    }
-
-    fn header_is_multiline(element: &SyntaxElement) -> Option<bool> {
-        next_token_sibling(&element.parent()?.first_child_or_token()?)
-            .map(|e| e.text().contains('\n'))
-    }
-
-    body_has_newline(element) == Some(true)
-        || (header_is_multiline(element) == Some(true) || header_has_multi_value(element))
+fn let_header_has_newline(element: &SyntaxElement) -> bool {
+    let letin = match element {
+        NodeOrToken::Token(token) => Some(token.parent()),
+        NodeOrToken::Node(node) => node.parent(),
+    };
+    // element.as_node().and_then(|x|x.parent());
+    letin
+        .map(|x| {
+            let mut nodes: Vec<SyntaxElement> = x
+                .children_with_tokens()
+                .into_iter()
+                .take_while(|x| match x {
+                    NodeOrToken::Node(_) => true,
+                    NodeOrToken::Token(token) => token.kind() != TOKEN_IN,
+                })
+                .collect();
+            nodes.pop();
+            nodes.into_iter().any(|child| match child {
+                NodeOrToken::Node(node) => has_newline(&node),
+                NodeOrToken::Token(token) => token.text().contains("\n"),
+            })
+        })
+        .unwrap_or(false)
 }
 
 #[rustfmt::skip]
diff --git a/src/tree_utils.rs b/src/tree_utils.rs
index 39033d5..e4b9cb1 100644
--- a/src/tree_utils.rs
+++ b/src/tree_utils.rs
@@ -85,13 +85,6 @@ pub(crate) fn on_top_level(element: &SyntaxElement) -> bool {
     }
 }
 
-pub(crate) fn next_token_sibling(element: &SyntaxElement) -> Option<SyntaxToken> {
-    match element.next_sibling_or_token()? {
-        NodeOrToken::Node(_) => None,
-        NodeOrToken::Token(it) => Some(it),
-    }
-}
-
 pub(crate) fn prev_token_sibling(element: &SyntaxElement) -> Option<SyntaxToken> {
     successors(element.prev_sibling_or_token(), |it| it.prev_sibling_or_token()).find_map(
         |element| match element {


Test patch:
diff --git a/test_data/curried_fn.good.nix b/test_data/curried_fn.good.nix
index 5e446c6..cdf5c2c 100644
--- a/test_data/curried_fn.good.nix
+++ b/test_data/curried_fn.good.nix
@@ -1,6 +1,8 @@
 {
   mkValueStringDefault = {}: v: with builtins;
-    let err = t: v: abort
-      "oups";
-    in 92;
+    let
+      err = t: v: abort
+        "oups";
+    in
+    92;
 }
diff --git a/test_data/nixpkgs_repository/lib_attrset.good.nix b/test_data/nixpkgs_repository/lib_attrset.good.nix
index 3f19103..fe6239d 100644
--- a/test_data/nixpkgs_repository/lib_attrset.good.nix
+++ b/test_data/nixpkgs_repository/lib_attrset.good.nix
@@ -2,10 +2,7 @@
   matchAttrs = pattern: attrs: assert isAttrs pattern;
     fold and true (attrValues (zipAttrsWithNames (attrNames pattern)
       (n: values:
-        let
-          pat = head values;
-          val = head (tail values);
-        in
+        let pat = head values; val = head (tail values); in
         if length values == 1 then false
         else if isAttrs pat then isAttrs val && matchAttrs pat val
         else pat == val
diff --git a/test_data/nixpkgs_repository/lib_deprecated.good.nix b/test_data/nixpkgs_repository/lib_deprecated.good.nix
index c44161d..92a8de4 100644
--- a/test_data/nixpkgs_repository/lib_deprecated.good.nix
+++ b/test_data/nixpkgs_repository/lib_deprecated.good.nix
@@ -11,8 +11,7 @@
       then innerClosePropagation acc ys
       else
         let acc' = [ y ] ++ acc;
-        in
-        innerClosePropagation
+        in innerClosePropagation
           acc'
           (uniqList {
             inputList = (maybeAttrNullable "propagatedBuildInputs" [ ] y)
diff --git a/test_data/nixpkgs_repository/lib_modules.good.nix b/test_data/nixpkgs_repository/lib_modules.good.nix
index 7e69524..40dcc2b 100644
--- a/test_data/nixpkgs_repository/lib_modules.good.nix
+++ b/test_data/nixpkgs_repository/lib_modules.good.nix
@@ -23,9 +23,6 @@
     { pkg
     , num ? 0
     }:
-    let
-      val = 1;
-      num = 2;
-    in
+    let val = 1; num = 2; in
     pkg + num + val;
 }
diff --git a/test_data/nixpkgs_repository/nixos_lib_testing_python.good.nix b/test_data/nixpkgs_repository/nixos_lib_testing_python.good.nix
index 98c4515..c8068c7 100644
--- a/test_data/nixpkgs_repository/nixos_lib_testing_python.good.nix
+++ b/test_data/nixpkgs_repository/nixos_lib_testing_python.good.nix
@@ -1,33 +1,32 @@
 {
-  driver = let warn = if skipLint then lib.warn "Linting is disabled!" else lib.id; in
-    warn (runCommand testDriverName
-      {
-        buildInputs = [ makeWrapper ];
-        testScript = testScript';
-        preferLocalBuild = true;
-        testName = name;
-      }
-      ''
-        mkdir -p $out/bin
-        echo -n "$testScript" > $out/test-script
-        ${lib.optionalString (!skipLint) ''
-          ${python3Packages.black}/bin/black --check --diff $out/test-script
-        ''}
-        ln -s ${testDriver}/bin/nixos-test-driver $out/bin/
-        vms=($(for i in ${toString vms}; do echo $i/bin/run-*-vm; done))
-        wrapProgram $out/bin/nixos-test-driver \
-          --add-flags "''${vms[*]}" \
-          ${lib.optionalString enableOCR
-          "--prefix PATH : '${ocrProg}/bin:${imagemagick_tiff}/bin'"} \
-          --run "export testScript=\"\$(${coreutils}/bin/cat $out/test-script)\"" \
-          --set VLANS '${toString vlans}'
-        ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
-        wrapProgram $out/bin/nixos-run-vms \
-          --add-flags "''${vms[*]}" \
-          ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin'"} \
-          --set tests 'start_all(); join_all();' \
-          --set VLANS '${toString vlans}' \
-          ${lib.optionalString (builtins.length vms == 1) "--set USE_SERIAL 1"}
-      ''
-    ); # "
+  driver = let warn = if skipLint then lib.warn "Linting is disabled!" else lib.id; in warn (runCommand testDriverName
+    {
+      buildInputs = [ makeWrapper ];
+      testScript = testScript';
+      preferLocalBuild = true;
+      testName = name;
+    }
+    ''
+      mkdir -p $out/bin
+      echo -n "$testScript" > $out/test-script
+      ${lib.optionalString (!skipLint) ''
+        ${python3Packages.black}/bin/black --check --diff $out/test-script
+      ''}
+      ln -s ${testDriver}/bin/nixos-test-driver $out/bin/
+      vms=($(for i in ${toString vms}; do echo $i/bin/run-*-vm; done))
+      wrapProgram $out/bin/nixos-test-driver \
+        --add-flags "''${vms[*]}" \
+        ${lib.optionalString enableOCR
+        "--prefix PATH : '${ocrProg}/bin:${imagemagick_tiff}/bin'"} \
+        --run "export testScript=\"\$(${coreutils}/bin/cat $out/test-script)\"" \
+        --set VLANS '${toString vlans}'
+      ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
+      wrapProgram $out/bin/nixos-run-vms \
+        --add-flags "''${vms[*]}" \
+        ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin'"} \
+        --set tests 'start_all(); join_all();' \
+        --set VLANS '${toString vlans}' \
+        ${lib.optionalString (builtins.length vms == 1) "--set USE_SERIAL 1"}
+    ''
+  ); # "
 }