Discussed nixpkgs-architecture/simple-package-paths#27 with @roberth, resulting in nixpkgs-architecture/simple-package-paths#28
These notes are rather unorganized, but contain some ideas
{ python }:
python.buildPythonApplication {
}
{ python ? python3, python3 }:
python.buildPythonApplication {
}
foo = callPackage ./path/to/foo {
python = python3;
}
graphviz = callPackage ./path/to/graphviz {}
builtins.potentialInfiniteRecursionErrorContext ""
builtins.addErrorContextUnderSomeUnspecifiedCondition graphviz-nox "foo" (graphviz.override { ... })
graphviz-nox = builtins.addErrorContext "If you want to make graphviz-nox the default graphviz, use ${__curPos} instead" (self.graphviz.override { xlib = null; })
1000 that depend on graphviz
graphviz-nox = callPackage ./path/to/graphviz { xlib = null; }
graphviz = super.graphviz.override self.graphviz-nox.arguments;
graphviz = super.graphviz.override { xlib = null; }
aliases = { graphviz = [ "graphviz-nox" ] pythonPackages = [ "python" "pkgs" ]; }
aliases = { pythonPackages = mkForce [ "python3" "pkgs" ]; }
config = { noXlibs = true; }
options.services.foo = lib.mkOption { type = types.submodule [ ./options ./defaults ]; }
config.services.foo = { imports = [ ./dangerous.nix ]; };
unit.graphviz = callPackage ./path/to/graphviz; graphviz = unit.graphviz {};
graphviz = unit.graphviz {} //(lazy) { override = new: unit.graphviz new; }
graphviz-nox = self.graphviz.override { xlibs = null; }
{ aliasedTo = [ "graphviz" ]; override = { xlibs = false; }; }
graphviz = self.graphviz-nox;
import { extraUnits = ./some/extras; overriddenUnits = ./some/overrides; }
stdenv.mkDerivation {
}
{ foo }: foo.override { ... }
{ foo.parent = "repo1"; }
graph = callPackage ./unit/graph {};
graph = super.graph.override { xlib = null; }
graph-nox = super.graph.override { xlib = null; }
graph = self.graph-nox;
#graphviz/default.nix { stdenv, lib, xlibs, config, enableXlibs ? ! config.noXlib } stdenv.mkDerivation { buildInputs = lib.optional xlibsEnable xlibs }
Orthogonal