summary refs log tree commit diff
path: root/ripple/nix/default.nix
diff options
context:
space:
mode:
authorV <v@unfathomable.blue>2021-08-12 14:08:17 +0200
committerV <v@unfathomable.blue>2021-08-14 02:06:23 +0200
commit47db036c9e288810a8988f1ff92746daad3a15c4 (patch)
tree965937346b94c061682b266b46ee826d43a6bdb7 /ripple/nix/default.nix
parentb465ad3cb308d2cd0d37b7fe96e3359c4eca4f75 (diff)
ripple/nix: add rustfmt `imports_granularity = "One"` patch
This lets us use an unreleased formatting variant that merges all use
statements into a single block.

Change-Id: I0ff9fb960171c9af3dbd3a841e35e17a4965a246
Diffstat (limited to 'ripple/nix/default.nix')
-rw-r--r--ripple/nix/default.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/ripple/nix/default.nix b/ripple/nix/default.nix
index 065fdee..cf4273b 100644
--- a/ripple/nix/default.nix
+++ b/ripple/nix/default.nix
@@ -2,4 +2,16 @@
 # SPDX-License-Identifier: OSL-3.0
 
 let sources = import ./sources.nix {};
-in import sources.nixpkgs {}
+in import sources.nixpkgs {
+  overlays = [
+    (final: prev: {
+      rustfmt = prev.rustfmt.overrideAttrs ({ patches ? [], ... }: {
+        patches = patches ++ [
+          # Adds an option variant that merges all use statements into a single block.
+          # Taken from https://github.com/rust-lang/rustfmt/pull/4680
+          ./Implement-One-option-for-imports_granularity-4669.patch  
+        ];
+      });
+    })
+  ];
+}