factor out components with callPackage to allow for easier overrides
Before this change it was very inconvenient to override specific dependencies, e.g. patching something in pythonEnv and having its dependents use that patched version. This is just a step towards better overridability for the individual authentik components, because patched versions of components still need to be manually passed to their dependents. An overlay-like approach would be even better.
This commit is contained in:
parent
d12bdcc87d
commit
6df56466f9
8 changed files with 191 additions and 118 deletions
24
components/pythonEnv.nix
Normal file
24
components/pythonEnv.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ authentik-src
|
||||
, authentikPoetryOverrides
|
||||
, defaultPoetryOverrides
|
||||
, lib
|
||||
, mkPoetryEnv
|
||||
, python311
|
||||
}:
|
||||
|
||||
mkPoetryEnv {
|
||||
projectDir = authentik-src;
|
||||
python = python311;
|
||||
overrides = [
|
||||
defaultPoetryOverrides
|
||||
] ++ authentikPoetryOverrides;
|
||||
groups = [];
|
||||
checkGroups = [];
|
||||
# workaround to remove dev-dependencies for the current combination of legacy
|
||||
# used by authentik and poetry2nix's behavior
|
||||
pyproject = builtins.toFile "patched-pyproject.toml" (lib.replaceStrings
|
||||
["tool.poetry.dev-dependencies"]
|
||||
["tool.poetry.group.dev.dependencies"]
|
||||
(builtins.readFile "${authentik-src}/pyproject.toml")
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue