Skip to content

Commit 4f7c654

Browse files
committed
nrfutil: guard nrfutil-completion as optional on all platforms
nrfutil-completion is absent from source.nix on some platforms (e.g. aarch64-linux). Unconditionally listing it in the packages map causes an evaluation error ('attribute nrfutil-completion missing') on those platforms. Guard the package with lib.optional and the postBuild shell completion installation with lib.optionalString, both keyed on 'platformSources.packages ? nrfutil-completion', so the build succeeds on every supported platform. Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
1 parent 63ae13a commit 4f7c654

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pkgs/by-name/nr/nrfutil/package.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ let
9898
(
9999
[
100100
"nrfutil"
101-
"nrfutil-completion"
102101
]
102+
++ lib.optional (platformSources.packages ? nrfutil-completion) "nrfutil-completion"
103103
++ extensions
104104
);
105105

@@ -151,9 +151,11 @@ symlinkJoin {
151151
''
152152
wrapProgram "$out"/bin/nrfutil ${wrapProgramArgs}
153153
154-
installShellCompletion --cmd nrfutil \
155-
--bash $(realpath "$out"/share/nrfutil-completion/scripts/bash/setup.bash) \
156-
--zsh $(realpath "$out"/share/nrfutil-completion/scripts/zsh/_nrfutil)
154+
${lib.optionalString (platformSources.packages ? nrfutil-completion) ''
155+
installShellCompletion --cmd nrfutil \
156+
--bash $(realpath "$out"/share/nrfutil-completion/scripts/bash/setup.bash) \
157+
--zsh $(realpath "$out"/share/nrfutil-completion/scripts/zsh/_nrfutil)
158+
''}
157159
'';
158160

159161
passthru =

0 commit comments

Comments
 (0)