Skip to content

Commit 6888dc0

Browse files
committed
fix: collection of cargo.nix dirs to be unique and not error when root
Cargo.nix hasn't been set
1 parent 2876645 commit 6888dc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nix/public-flake-module.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ ourArgs:
334334
in builtins.dirOf (builtins.unsafeDiscardStringContext
335335
(lib.concatStringsSep "/" inRepoFileSplit));
336336

337-
cargoNixDirs = lib.map getCargoNixDir
338-
([ cfg.cargoNix.path ] ++
339-
(lib.mapAttrsToList (_: v: v.cargoNix.path) cfg.extraBuilds));
340-
337+
cargoNixDirs = lib.unique (lib.map getCargoNixDir
338+
((lib.optionals (cfg.cargoNix ? path) [ cfg.cargoNix.path ]) ++
339+
(lib.mapAttrsToList (_: v: v.cargoNix.path) cfg.extraBuilds)));
340+
341341
in {
342342
options.crate2nix = lib.mkOption {
343343
type = types.submoduleWith {

0 commit comments

Comments
 (0)