Add django-simple-csp derivation and include it in the Python environment

This commit is contained in:
Philip Henning 2025-07-08 21:52:35 +02:00
parent 56830dfebd
commit 50fe701290

View file

@ -19,6 +19,31 @@
sha256 = "sha256-R4OwQdSJu9+EAlkhYOEe2ZOrS9oOA1ifg/iY6uzYSpE=";
};
# Create django-simple-csp derivation
django-simple-csp = pkgs.python3.pkgs.buildPythonPackage rec {
pname = "django-simple-csp";
version = "0.4.dev1";
src = pkgs.fetchFromGitHub {
owner = "fsinfuhh";
repo = "django-simple-csp";
rev = "207afedec1bf28af5de070da919061474b1f6a21";
sha256 = "sha256-1rvdplHPjVZ6li831/sQT+lL4rE8ME1eLfeSd0EKHb4=";
};
propagatedBuildInputs = with pkgs.python3.pkgs; [
django
];
doCheck = false; # Skip tests during build
meta = with pkgs.lib; {
description = "Django Content Security Policy support";
homepage = "https://github.com/fsinfuhh/django-simple-csp";
license = licenses.mit;
};
};
# Create settings_local.py for production
settingsLocal = pkgs.writeText "settings_local.py" ''
import os
@ -69,6 +94,7 @@
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
# Core Django dependencies
django
django-simple-csp
# Calendar and date handling
caldav
@ -144,7 +170,6 @@
mkdir -p $out/lib/python3.12/site-packages
${pythonEnv}/bin/pip install --target $out/lib/python3.12/site-packages \
django-simple-csp==0.4.dev1 \
django-markdownify==0.9.5 \
django-pipeline==3.1.0 \
django-friendly-tag-loader==1.3.1 \