From 7f0fd2bb6de504541f9c9fa8eaf5126087ae81a3 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 21 Dec 2024 11:06:19 -0400 Subject: Rewrite mktags.sh to MakeTags.py This makes tags for all third-party dependencies, and uses universal-ctags instead of fast-tags. It's so nice having tags for /everything/. It's also pretty fast, and caches the result for third-party deps anyway. Oh yeah this also added an explicit list of third-party Python packages. I need to filter the entire pkgset down to just the ones I'm using in order to make tags for them. --- Biz/Bild.nix | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'Biz/Bild.nix') diff --git a/Biz/Bild.nix b/Biz/Bild.nix index 8e33d93..c24cecd 100644 --- a/Biz/Bild.nix +++ b/Biz/Bild.nix @@ -14,6 +14,19 @@ let unstable = nixpkgs.nixos-unstable-small; + # get the .src attributes of all drvs in each pkgset in the `sources` list, + # and concat them with `:` into a Unix-style search path. + # makeSourcesPath :: [pkgset] -> str + makeSourcesPath = with stable; + sources: + lib.trivial.pipe sources [ + (builtins.map lib.attrsets.attrValues) + lib.lists.flatten + (builtins.filter (pkg: pkg != null)) + (builtins.map (pkg: pkg.src)) + (lib.strings.concatStringsSep ":") + ]; + # this is the main library definitions, recursive references can be made with # `self.thing`, like in Python objects self = { @@ -68,7 +81,8 @@ let lisp = { sbclWith = stable.sbcl.withPackages; }; python = { - packages = stable.python3.pkgs; + packages = self.lib.attrsets.getAttrs (import ./Bild/Deps/Python.nix) + stable.python3.pkgs; pythonWith = stable.python3.withPackages; buildPythonApplication = stable.python3.pkgs.buildPythonApplication; }; @@ -83,8 +97,7 @@ let git-branchless gitlint groff guile hlint indent jq lolcat mypy nixfmt ormolu pkg-config ripgrep rustc tree wemux; llama-cpp = unstable.llama-cpp; - llm = python3.withPackages - (p: with p; [ p.llm-ollama ]); + llm = python3.withPackages (p: with p; [ p.llm-ollama ]); ollama = unstable.ollama; ruff = unstable.ruff; shellcheck = unstable.shellcheck; @@ -192,12 +205,18 @@ let llm ormolu ripgrep - stable.haskell.packages.${constants.ghcCompiler}.fast-tags tree wemux ]; shellHook = '' export GHC_PACKAGE_PATH=${self.bild}/lib/ghc-${self.haskell.ghcVersion}/package.conf.d + export ALL_SOURCES=${ + makeSourcesPath [ + self.python.packages + self.haskell.packages + self.c.packages + ] + } ''; }; -- cgit v1.2.3