From 50fe701290f5570392057aae1dc0b3747fb23f19 Mon Sep 17 00:00:00 2001 From: shokinn Date: Tue, 8 Jul 2025 21:52:35 +0200 Subject: [PATCH] Add django-simple-csp derivation and include it in the Python environment --- flake.nix | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index c1e97cf..6d48137 100644 --- a/flake.nix +++ b/flake.nix @@ -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 \