Repository: nix-community/nixpkgs-fmt (rust)

Issue:
sample: Indenting all but the first line is a bit too much.
I tried using `nixpkgs-fmt` on a test I was working on and it indented everything except for the first line an extra level, which seemed kind of ridiculous in the case of `nixos/tests/ceph-*.nix`. Below is a smaller example showing the same behavior, though to a much smaller extent since there are fewer lines for it to indent.

## Input
```nix
import ./make-test-python.nix ({pkgs, lib, ...}:

let
  foo = 42;
  bar = 57;
in {
  baz = qux;
})
```

## Output
```nix
import ./make-test-python.nix ({ pkgs, lib, ... }:

  let
    foo = 42;
    bar = 57;
  in
  {
    baz = qux;
  })

```

## Desired output

```nix
import ./make-test-python.nix ({pkgs, lib, ...}:

let
  foo = 42;
  bar = 57;
in {
  baz = qux;
})
```

Pull request description:
Remove indentation for lambda function in top level
fix #229 

Patch:
diff --git a/src/rules.rs b/src/rules.rs
index e0c5da7..a4facc2 100644
--- a/src/rules.rs
+++ b/src/rules.rs
@@ -432,7 +432,7 @@ pub(crate) fn indentation() -> IndentDsl {
                   92
                 )
             "#)
-
+        
         .rule("Indent attribute set content")
             .inside(NODE_ATTR_SET)
             .not_matching([T!["{"], T!["}"]])
diff --git a/src/tree_utils.rs b/src/tree_utils.rs
index 01e6d6b..39033d5 100644
--- a/src/tree_utils.rs
+++ b/src/tree_utils.rs
@@ -3,7 +3,7 @@ use std::iter::successors;
 use rnix::{
     NodeOrToken, SyntaxElement,
     SyntaxKind::{
-        NODE_APPLY, NODE_ASSERT, NODE_IF_ELSE, NODE_LAMBDA, NODE_LET_IN, NODE_ROOT,
+        NODE_APPLY, NODE_ASSERT, NODE_IF_ELSE, NODE_LAMBDA, NODE_LET_IN, NODE_PAREN, NODE_ROOT,
         NODE_STRING_INTERPOL, NODE_WITH, TOKEN_WHITESPACE,
     },
     SyntaxNode, SyntaxToken, WalkEvent,
@@ -79,9 +79,8 @@ pub(crate) fn on_top_level(element: &SyntaxElement) -> bool {
     };
     match parent.kind() {
         NODE_ROOT => true,
-        NODE_LAMBDA | NODE_APPLY | NODE_WITH | NODE_ASSERT | NODE_LET_IN | NODE_IF_ELSE => {
-            on_top_level(&parent.into())
-        }
+        NODE_LAMBDA | NODE_APPLY | NODE_WITH | NODE_ASSERT | NODE_LET_IN | NODE_IF_ELSE
+        | NODE_PAREN => on_top_level(&parent.into()),
         _ => false,
     }
 }


Test patch:
diff --git a/test_data/indent_lambda_top_level.bad.nix b/test_data/indent_lambda_top_level.bad.nix
new file mode 100644
index 0000000..a8a31b1
--- /dev/null
+++ b/test_data/indent_lambda_top_level.bad.nix
@@ -0,0 +1,7 @@
+import ./make-test-python.nix ({pkgs, lib, ...}:
+
+let
+  bar = 57;
+in {
+  baz = qux;
+})
\ No newline at end of file
diff --git a/test_data/indent_lambda_top_level.good.nix b/test_data/indent_lambda_top_level.good.nix
new file mode 100644
index 0000000..09d2c8e
--- /dev/null
+++ b/test_data/indent_lambda_top_level.good.nix
@@ -0,0 +1,8 @@
+import ./make-test-python.nix ({ pkgs, lib, ... }:
+
+let
+  bar = 57;
+in
+{
+  baz = qux;
+})