From 117652a6a6ee616635d8e1c6536fa9d8b546df87 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Tue, 10 Mar 2026 19:56:41 +0100 Subject: [PATCH] maint: put cargo completions in the dev shell --- package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.nix b/package.nix index 6b7cee9..8725d02 100644 --- a/package.nix +++ b/package.nix @@ -127,9 +127,14 @@ in { mkShell, python3Packages, fenixToolchain, + cargo, }: let mkShell' = mkShell.override { inherit stdenv; }; pyEnv = python3Packages.python.withPackages (p: [ p.beartype ]); + # Fenix's Cargo doesn't have completions, but Nixpkgs' does. + cargoCompletions = linkFarm "cargo-bash-completions" { + "share/bash-completion" = cargo + "/share/bash-completion"; + }; in mkShell' { name = "devshell-for-${self.name}"; inputsFrom = [ self ]; @@ -137,12 +142,15 @@ in { pyEnv stdenv.cc fenixToolchain + cargoCompletions ]; env.PYTHONPATH = [ "${pyEnv}/${pyEnv.sitePackages}" # Cursed. "${path}/nixos/lib/test-driver/src" ] |> lib.concatStringsSep ":"; + + passthru = { inherit cargoCompletions; }; }; passthru.modulesPath = self.modules + "/share/nixos/modules";