Skip to content

Commit 1733e23

Browse files
committed
Stop bootstrapping rnix-lsp as it is unmaintained
Also allow the possibility of not including buildInputs in a shell, since it's now possible to not require anything from nixpkgs.
1 parent dbf50ae commit 1733e23

File tree

8 files changed

+34
-55
lines changed

8 files changed

+34
-55
lines changed

.last-exported-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Last exported commit from parent repo: 6a71c253c9cb6e804e58f923f3c294ea164c99e1
1+
Last exported commit from parent repo: 67d50f90e5ca6530f4799983c0b11245988a6c3c

nix-bootstrap.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cabal-version: 2.0
55
-- see: https://github.com/sol/hpack
66

77
name: nix-bootstrap
8-
version: 1.5.5.3
8+
version: 1.5.6.0
99
author: gchquser
1010
maintainer: [email protected]
1111
copyright: Crown Copyright

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
name: nix-bootstrap
15-
version: 1.5.5.3
15+
version: 1.5.6.0
1616
author: gchquser
1717
maintainer: [email protected]
1818
copyright: Crown Copyright

src/Bootstrap/Data/Bootstrappable/NixShell.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ nixShellFor RunConfig {rcUseFlakes} projectType preCommitHooksConfig nixPreCommi
145145
. fmap EIdent
146146
nixpkgsBuildInputsFor :: ProjectType -> [Expr]
147147
nixpkgsBuildInputsFor =
148-
sortBy compareBuildInputs . (([nix|rnix-lsp|] : [[nix|niv|] | not rcUseFlakes]) <>) . \case
148+
sortBy compareBuildInputs . (([[nix|niv|] | not rcUseFlakes]) <>) . \case
149149
Minimal -> []
150150
Elm elmOptions ->
151151
[ [nix|elmPackages.elm|],

src/Bootstrap/Nix/Expr/BuildInputs.hs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,33 @@ data BuildInputSpec projectType = BuildInputSpec
5656
buildInputsBindings :: HasProjectSuperType t => BuildInputSpec t -> [Binding]
5757
buildInputsBindings spec@BuildInputSpec {bisNativeNixpkgsPackages} =
5858
catMaybes
59-
[ Just $ [nixproperty|buildInputs|] |= foldr (|++) buildInputGroupExpr1 otherBuildInputGroupExprs,
59+
[ case buildInputGroupExprs of
60+
[] -> Nothing
61+
[buildInputGroupExpr1] ->
62+
Just $ [nixproperty|buildInputs|] |= buildInputGroupExpr1
63+
(buildInputGroupExpr1 : otherBuildInputGroupExprs) ->
64+
Just $ [nixproperty|buildInputs|] |= foldr (|++) buildInputGroupExpr1 otherBuildInputGroupExprs,
6065
if null bisNativeNixpkgsPackages
6166
then Nothing
6267
else Just $ [nixproperty|nativeBuildInputs|] |= groupToExpr (BIGNativeNixpkgsInputs bisNativeNixpkgsPackages)
6368
]
6469
where
65-
buildInputGroups :: NonEmpty BuildInputGroup
70+
buildInputGroups :: [BuildInputGroup]
6671
buildInputGroups = buildInputGroupsFor spec
6772
groupPackageSets :: Bool
6873
groupPackageSets = length buildInputGroups > 1
6974
groupToExpr :: BuildInputGroup -> Expr
7075
groupToExpr g = (if groupPackageSets && requiresGrouping g then EGrouping else id) (toNixExpr g)
71-
buildInputGroupExpr1 :: Expr
72-
otherBuildInputGroupExprs :: [Expr]
73-
(buildInputGroupExpr1 :| otherBuildInputGroupExprs) = groupToExpr <$> buildInputGroups
76+
buildInputGroupExprs :: [Expr]
77+
buildInputGroupExprs = groupToExpr <$> buildInputGroups
7478

75-
buildInputGroupsFor :: HasProjectSuperType t => BuildInputSpec t -> NonEmpty BuildInputGroup
79+
buildInputGroupsFor :: HasProjectSuperType t => BuildInputSpec t -> [BuildInputGroup]
7680
buildInputGroupsFor BuildInputSpec {..} =
77-
BIGNixpkgs bisNixpkgsPackages
78-
:| catMaybes
79-
[ if unPreCommitHooksConfig bisPreCommitHooksConfig then Just BIGPreCommitHooks else Nothing,
80-
if projectSuperType bisProjectType == PSTPython then Just BIGPythonPackages else Nothing,
81-
case bisOtherPackages of
82-
[] -> Nothing
83-
otherPackages -> Just $ BIGOther otherPackages
84-
]
81+
catMaybes
82+
[ if null bisNixpkgsPackages then Nothing else Just (BIGNixpkgs bisNixpkgsPackages),
83+
if unPreCommitHooksConfig bisPreCommitHooksConfig then Just BIGPreCommitHooks else Nothing,
84+
if projectSuperType bisProjectType == PSTPython then Just BIGPythonPackages else Nothing,
85+
case bisOtherPackages of
86+
[] -> Nothing
87+
otherPackages -> Just $ BIGOther otherPackages
88+
]

test/Bootstrap/Data/Bootstrappable/FlakeNixSpec.hs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ spec = describe "flake.nix rendering" do
4949
in {
5050
devShell = self.devShells.${system}.default;
5151
devShells.default = nixpkgs.mkShell {
52-
buildInputs = with nixpkgs; [
53-
awscli2
54-
nodejs
55-
rnix-lsp
56-
];
52+
buildInputs = with nixpkgs; [awscli2 nodejs];
5753
};
5854
});
5955
}
@@ -88,7 +84,6 @@ spec = describe "flake.nix rendering" do
8884
awscli2
8985
nodePackages.pnpm
9086
nodejs
91-
rnix-lsp
9287
];
9388
};
9489
});
@@ -137,13 +132,7 @@ spec = describe "flake.nix rendering" do
137132
checks.pre-commit-check = preCommitHooks.pureHooks;
138133
devShell = self.devShells.${system}.default;
139134
devShells.default = nixpkgs.mkShell {
140-
buildInputs =
141-
preCommitHooks.tools
142-
++ (with nixpkgs; [
143-
awscli2
144-
nodejs
145-
rnix-lsp
146-
]);
135+
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [awscli2 nodejs]);
147136
inherit (preCommitHooks.allHooks) shellHook;
148137
};
149138
# runChecks is a hack required to allow checks to run on a single system
@@ -198,7 +187,7 @@ spec = describe "flake.nix rendering" do
198187
checks.pre-commit-check = preCommitHooks.pureHooks;
199188
devShell = self.devShells.${system}.default;
200189
devShells.default = nixpkgs.mkShell {
201-
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [go rnix-lsp]);
190+
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [go]);
202191
inherit (preCommitHooks.allHooks) shellHook;
203192
};
204193
defaultPackage = self.packages.${system}.default;
@@ -246,7 +235,7 @@ spec = describe "flake.nix rendering" do
246235
in {
247236
devShell = self.devShells.${system}.default;
248237
devShells.default = nixpkgs.mkShell {
249-
buildInputs = [pythonPackages] ++ (with nixpkgs; [rnix-lsp]);
238+
buildInputs = [pythonPackages];
250239
};
251240
});
252241
}
@@ -294,7 +283,7 @@ spec = describe "flake.nix rendering" do
294283
checks.pre-commit-check = preCommitHooks.pureHooks;
295284
devShell = self.devShells.${system}.default;
296285
devShells.default = nixpkgs.mkShell {
297-
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [libiconv rnix-lsp]);
286+
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [libiconv]);
298287
nativeBuildInputs = with nixpkgs; [
299288
cargo
300289
rust-analyzer

test/Bootstrap/Data/Bootstrappable/NixShellSpec.hs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ in
3636
awscli2
3737
niv
3838
nodejs
39-
rnix-lsp
4039
];
4140
}
4241
|]
@@ -55,7 +54,6 @@ in
5554
niv
5655
nodePackages.pnpm
5756
nodejs
58-
rnix-lsp
5957
];
6058
}
6159
|]
@@ -74,13 +72,7 @@ in
7472
};
7573
in
7674
nixpkgs.mkShell {
77-
buildInputs =
78-
preCommitHooks.tools
79-
++ (with nixpkgs; [
80-
go
81-
niv
82-
rnix-lsp
83-
]);
75+
buildInputs = preCommitHooks.tools ++ (with nixpkgs; [go niv]);
8476
inherit (preCommitHooks.allHooks) shellHook;
8577
}
8678
|]
@@ -110,7 +102,7 @@ in
110102
haskellEnv = haskellPackages.ghcWithPackages (pkgs: with pkgs; [cabal-install haskell-language-server]);
111103
in
112104
nixpkgs.mkShell {
113-
buildInputs = [haskellEnv] ++ (with nixpkgs; [niv rnix-lsp]);
105+
buildInputs = [haskellEnv] ++ (with nixpkgs; [niv]);
114106
}
115107
|]
116108
)
@@ -131,7 +123,7 @@ in
131123
};
132124
in
133125
nixpkgs.mkShell {
134-
buildInputs = [pythonPackages] ++ (with nixpkgs; [niv rnix-lsp]);
126+
buildInputs = [pythonPackages] ++ (with nixpkgs; [niv]);
135127
}
136128
|]
137129
)
@@ -157,7 +149,7 @@ in
157149
};
158150
in
159151
nixpkgs.mkShell {
160-
buildInputs = preCommitHooks.tools ++ [pythonPackages] ++ (with nixpkgs; [niv rnix-lsp]);
152+
buildInputs = preCommitHooks.tools ++ [pythonPackages] ++ (with nixpkgs; [niv]);
161153
inherit (preCommitHooks.allHooks) shellHook;
162154
}
163155
|]
@@ -172,11 +164,7 @@ in
172164
nixpkgs = import sources.nixpkgs {};
173165
in
174166
nixpkgs.mkShell {
175-
buildInputs = with nixpkgs; [
176-
libiconv
177-
niv
178-
rnix-lsp
179-
];
167+
buildInputs = with nixpkgs; [libiconv niv];
180168
nativeBuildInputs = with nixpkgs; [
181169
cargo
182170
rust-analyzer

test/Bootstrap/Nix/Expr/MkShellSpec.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,24 @@ spec = do
2323
it "gives no shell hook when one isn't needed" do
2424
mkShell (BuildInputSpec [] [] (PreCommitHooksConfig False) PSTMinimal [])
2525
`shouldBe` [nix|nixpkgs.mkShell {
26-
buildInputs = with nixpkgs; [];
2726
}|]
2827
it "gives a proper shell hook for projects with pre-commit hooks" do
2928
mkShell (BuildInputSpec [] [] (PreCommitHooksConfig True) PSTMinimal [])
3029
`shouldBe` [nix|nixpkgs.mkShell {
31-
buildInputs = preCommitHooks.tools ++ (with nixpkgs; []);
30+
buildInputs = preCommitHooks.tools;
3231
inherit (preCommitHooks.allHooks) shellHook;
3332
}|]
3433
it "gives a proper shell hook for Rust projects" do
3534
mkShell (BuildInputSpec [] [] (PreCommitHooksConfig False) PSTRust [])
3635
`shouldBe` [nix|nixpkgs.mkShell {
37-
buildInputs = with nixpkgs; [];
3836
shellHook = ''
3937
export RUST_SRC_PATH=${nixpkgs.rustPlatform.rustLibSrc}
4038
'';
4139
}|]
4240
it "gives a proper shell hook for Rust projects with pre-commit hooks" do
4341
mkShell (BuildInputSpec [] [] (PreCommitHooksConfig True) PSTRust [])
4442
`shouldBe` [nix|nixpkgs.mkShell {
45-
buildInputs = preCommitHooks.tools ++ (with nixpkgs; []);
43+
buildInputs = preCommitHooks.tools;
4644
shellHook = ''
4745
export RUST_SRC_PATH=${nixpkgs.rustPlatform.rustLibSrc}
4846
${preCommitHooks.allHooks.shellHook}

0 commit comments

Comments
 (0)