diff options
author | Ben Sima <ben@bsima.me> | 2024-12-21 11:06:19 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2024-12-21 10:06:19 -0500 |
commit | 7f0fd2bb6de504541f9c9fa8eaf5126087ae81a3 (patch) | |
tree | 759f07f538353304aed1961916466e8b47c787a5 /Biz/Bild.nix | |
parent | 2f6cd392ad63d5f2d21a2a5b45038dc127a2c3a9 (diff) |
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.
Diffstat (limited to 'Biz/Bild.nix')
-rw-r--r-- | Biz/Bild.nix | 27 |
1 files changed, 23 insertions, 4 deletions
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 + ] + } ''; }; |