2024-07-15 19:17:57 -04:00
|
|
|
{
|
|
|
|
self,
|
2024-07-28 14:15:06 -04:00
|
|
|
poetryConfig,
|
|
|
|
poetry2nix,
|
2024-07-15 19:17:57 -04:00
|
|
|
inputs,
|
|
|
|
checks,
|
|
|
|
system,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
2024-07-15 19:42:22 -04:00
|
|
|
let
|
|
|
|
inherit (inputs) nixpkgs;
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2024-07-15 19:17:57 -04:00
|
|
|
|
2024-07-15 19:42:22 -04:00
|
|
|
# construct the shell provided by pre-commit for running hooks
|
|
|
|
pre-commit = pkgs.mkShell {
|
|
|
|
inherit (checks.pre-commit-check) shellHook;
|
|
|
|
buildInputs = checks.pre-commit-check.enabledPackages;
|
|
|
|
};
|
2024-07-15 19:17:57 -04:00
|
|
|
|
2024-07-15 19:42:22 -04:00
|
|
|
# constructs a custom shell with commonly used utilities
|
|
|
|
rad-dev = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
|
|
|
deadnix
|
|
|
|
pre-commit
|
|
|
|
treefmt
|
|
|
|
statix
|
|
|
|
nixfmt-rfc-style
|
2024-07-28 14:15:06 -04:00
|
|
|
ruff
|
2024-07-15 19:42:22 -04:00
|
|
|
];
|
|
|
|
};
|
2024-07-15 19:17:57 -04:00
|
|
|
|
2024-07-15 19:42:22 -04:00
|
|
|
# constructs the application in-place
|
|
|
|
app = pkgs.mkShell { inputsFrom = [ self.packages.${system}.myapp ]; };
|
2024-07-15 19:17:57 -04:00
|
|
|
|
2024-07-15 19:42:22 -04:00
|
|
|
# pull in python/poetry dependencies
|
|
|
|
poetry = pkgs.mkShell { packages = [ pkgs.poetry ]; };
|
2024-07-28 14:15:06 -04:00
|
|
|
|
|
|
|
poetry2nixshell = poetry2nix.mkPoetryEnv poetryConfig;
|
2024-07-15 19:42:22 -04:00
|
|
|
in
|
|
|
|
{
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
inputsFrom = [
|
|
|
|
pre-commit
|
|
|
|
rad-dev
|
|
|
|
app
|
|
|
|
poetry
|
2024-07-28 14:15:06 -04:00
|
|
|
poetry2nixshell
|
2024-07-15 19:42:22 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|