2024-10-23 10:45:15 +02:00
|
|
|
{
|
|
|
|
sources ? import ./npins,
|
|
|
|
pkgs ? import sources.nixpkgs { },
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
|
|
|
|
|
|
|
check = (import sources.git-hooks).run {
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
hooks = {
|
|
|
|
# Python hooks
|
|
|
|
black = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
isort = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
ruff = {
|
|
|
|
enable = true;
|
|
|
|
stages = [ "pre-push" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Misc Hooks
|
|
|
|
commitizen.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
python3 = pkgs.python3.override {
|
|
|
|
packageOverrides = _: _: {
|
|
|
|
inherit (nix-pkgs) django-cas-ng django-solo loadcredential;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
devShell = pkgs.mkShell {
|
|
|
|
name = "annuaire.dev";
|
|
|
|
|
|
|
|
packages = [
|
|
|
|
(python3.withPackages (ps: [
|
|
|
|
ps.django
|
|
|
|
ps.django-cas-ng
|
|
|
|
ps.django-markdownx
|
|
|
|
ps.django-solo
|
|
|
|
ps.markdown
|
|
|
|
ps.pillow
|
|
|
|
ps.loadcredential
|
2024-10-23 13:17:59 +02:00
|
|
|
|
|
|
|
# Dev packages
|
|
|
|
ps.django-stubs
|
2024-10-23 10:45:15 +02:00
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
env = {
|
|
|
|
DJANGO_SETTINGS_MODULE = "app.settings";
|
|
|
|
|
|
|
|
CREDENTIALS_DIRECTORY = builtins.toString ./.credentials;
|
|
|
|
|
|
|
|
BOCAL_DEBUG = builtins.toJSON true;
|
|
|
|
BOCAL_STATIC_ROOT = builtins.toString ./.static;
|
2024-10-23 13:17:59 +02:00
|
|
|
BOCAL_RHOSTS_PATH = builtins.toString ./.rhosts;
|
2024-10-23 10:45:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${check.shellHook}
|
|
|
|
|
|
|
|
if [ ! -d .static ]; then
|
|
|
|
mkdir .static
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|