Skip to content

bitbloxhub/callpackage-tree

Repository files navigation

callpackage-tree

Tiny helper for dendritic flake-parts setups.

Implements @mightyiam's dendritic guidance for interspersed pkgs.callPackage files: keep package files next to module files, exclude them from auto-import with *.pkg.nix, expose them as perSystem.packages.

Loads *.pkg.nix.

Mapping:

  • nix/default.pkg.nix -> packages.<system>.default
  • nix/a/default.pkg.nix -> packages.<system>.a
  • nix/a/b.pkg.nix -> packages.<system>.b

Duplicate package names throw at eval time.

Use

Consume repo as non-flake input. Import callpackage-tree manually.

{
  inputs.callpackage-tree = {
    url = "github:bitbloxhub/callpackage-tree";
    flake = false;
  };

  outputs = inputs@{ flake-parts, callpackage-tree, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        (import callpackage-tree {
          root = ./nix;
        })
      ];
    };
}

Exclude *.pkg.nix from your normal dendritic/import-tree module auto-imports, eg with .filterNot (inputs.nixpkgs.lib.hasSuffix ".pkg.nix").

Package args

Each discovered package file gets:

{
  inputs,
  inputs',
  self,
  self',
  # Regular callPackage args
  ...
}

Options:

  • root: dir to scan
  • suffix: package suffix, default ".pkg.nix"

About

Dendritic helper for flake-parts that discovers interspersed callPackage files and exposes them as perSystem.packages.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages