Add Django package derivations for markdownify, pipeline, friendly-tag-loader, token-bucket, widget-tweaks, and libsasscompiler
This commit is contained in:
		
							parent
							
								
									50fe701290
								
							
						
					
					
						commit
						fef078ea7c
					
				
					 1 changed files with 156 additions and 17 deletions
				
			
		
							
								
								
									
										173
									
								
								flake.nix
									
										
									
									
									
								
							
							
						
						
									
										173
									
								
								flake.nix
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -44,6 +44,154 @@
 | 
			
		|||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create django-markdownify derivation
 | 
			
		||||
        django-markdownify = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "django-markdownify";
 | 
			
		||||
          version = "0.9.5";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchurl {
 | 
			
		||||
            url = "https://files.pythonhosted.org/packages/6c/33/3abb966e2b238af4c9a5d3ee38a7aa7e51b644b4b20bf8533b6fd1c1bf96/django_markdownify-0.9.5.tar.gz";
 | 
			
		||||
            sha256 = "sha256-NMNOukp5coKlxb2XsTzshNakwGc61HzhwdAA103Y1Ks=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            django
 | 
			
		||||
            markdown
 | 
			
		||||
            bleach
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "Django Markdownify";
 | 
			
		||||
            homepage = "https://github.com/erwinmatijsen/django-markdownify";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create django-pipeline derivation
 | 
			
		||||
        django-pipeline = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "django-pipeline";
 | 
			
		||||
          version = "3.1.0";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchurl {
 | 
			
		||||
            url = "https://files.pythonhosted.org/packages/2c/22/24a8fdfb07ebd60ed9af004cfbef4df0ee5af9fb9c06ad1d3e6e1e5b33ac/django_pipeline-3.1.0.tar.gz";
 | 
			
		||||
            sha256 = "sha256-NkcK7O1IiWlLiZqZW80u2lEvRbYaxo1QrcWGPIutXuQ=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          nativeBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            setuptools-scm
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            django
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "Django Pipeline";
 | 
			
		||||
            homepage = "https://github.com/jazzband/django-pipeline";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create django-friendly-tag-loader derivation
 | 
			
		||||
        django-friendly-tag-loader = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "django-friendly-tag-loader";
 | 
			
		||||
          version = "1.3.1";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchPypi {
 | 
			
		||||
            inherit pname version;
 | 
			
		||||
            sha256 = "sha256-MVkoByRe71G6m3HKf3qqMbP7YYtVmNMCbK6xo4bhKJo=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            django
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "Django Friendly Tag Loader";
 | 
			
		||||
            homepage = "https://github.com/jazzband/django-friendly-tag-loader";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create django-token-bucket derivation
 | 
			
		||||
        django-token-bucket = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "django-token-bucket";
 | 
			
		||||
          version = "0.2.4";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchurl {
 | 
			
		||||
            url = "https://files.pythonhosted.org/packages/68/38/b940b6660f89efa969cce6ef5a43ea96cfa92ba57baf97a11c8dda87e413/django_token_bucket-0.2.4.tar.gz";
 | 
			
		||||
            sha256 = "sha256-hkj4Vo2OXI0IR/T6/qzt5ZPPLCFJNnNWyEm9hkervCQ=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            django
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "Django Token Bucket";
 | 
			
		||||
            homepage = "https://github.com/dcwatson/django-token-bucket";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create django-widget-tweaks derivation
 | 
			
		||||
        django-widget-tweaks = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "django-widget-tweaks";
 | 
			
		||||
          version = "1.5.0";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchurl {
 | 
			
		||||
            url = "https://files.pythonhosted.org/packages/a5/fe/26eb92fba83844e71bbec0ced7fc2e843e5990020e3cc676925204031654/django-widget-tweaks-1.5.0.tar.gz";
 | 
			
		||||
            sha256 = "sha256-HCGAaB67mU6SLHVIBMf/674SRQFHd6xHiXqB9XzGKcc=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          nativeBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            setuptools-scm
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            django
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "Django Widget Tweaks";
 | 
			
		||||
            homepage = "https://github.com/jazzband/django-widget-tweaks";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create libsasscompiler derivation
 | 
			
		||||
        libsasscompiler = pkgs.python3.pkgs.buildPythonPackage rec {
 | 
			
		||||
          pname = "libsasscompiler";
 | 
			
		||||
          version = "0.1.9";
 | 
			
		||||
          
 | 
			
		||||
          src = pkgs.fetchPypi {
 | 
			
		||||
            inherit pname version;
 | 
			
		||||
            sha256 = "sha256-OQ9hJ/8tR4U4O4Oj6UlD47Ac9CclH22Ys9Kkhj1RzBQ=";
 | 
			
		||||
          };
 | 
			
		||||
          
 | 
			
		||||
          propagatedBuildInputs = with pkgs.python3.pkgs; [
 | 
			
		||||
            setuptools
 | 
			
		||||
          ];
 | 
			
		||||
          
 | 
			
		||||
          doCheck = false; # Skip tests during build
 | 
			
		||||
          
 | 
			
		||||
          meta = with pkgs.lib; {
 | 
			
		||||
            description = "LibSass Compiler";
 | 
			
		||||
            homepage = "https://github.com/sass/libsass-python";
 | 
			
		||||
            license = licenses.mit;
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        # Create settings_local.py for production
 | 
			
		||||
        settingsLocal = pkgs.writeText "settings_local.py" ''
 | 
			
		||||
          import os
 | 
			
		||||
| 
						 | 
				
			
			@ -95,6 +243,12 @@
 | 
			
		|||
          # Core Django dependencies
 | 
			
		||||
          django
 | 
			
		||||
          django-simple-csp
 | 
			
		||||
          django-markdownify
 | 
			
		||||
          django-pipeline
 | 
			
		||||
          django-friendly-tag-loader
 | 
			
		||||
          django-token-bucket
 | 
			
		||||
          django-widget-tweaks
 | 
			
		||||
          libsasscompiler
 | 
			
		||||
          
 | 
			
		||||
          # Calendar and date handling
 | 
			
		||||
          caldav
 | 
			
		||||
| 
						 | 
				
			
			@ -129,9 +283,6 @@
 | 
			
		|||
          setuptools
 | 
			
		||||
          wheel
 | 
			
		||||
          pip
 | 
			
		||||
          
 | 
			
		||||
          # Available Django packages
 | 
			
		||||
          # Note: Some packages will need to be installed via pip in postInstall
 | 
			
		||||
        ]);
 | 
			
		||||
 | 
			
		||||
        bitpoll = pkgs.stdenv.mkDerivation rec {
 | 
			
		||||
| 
						 | 
				
			
			@ -165,24 +316,12 @@
 | 
			
		|||
            mkdir -p $out/share/bitpoll
 | 
			
		||||
            cp -r . $out/share/bitpoll/
 | 
			
		||||
            
 | 
			
		||||
            # Install missing Python packages via pip
 | 
			
		||||
            export PYTHONPATH=$out/lib/python3.12/site-packages:$PYTHONPATH
 | 
			
		||||
            mkdir -p $out/lib/python3.12/site-packages
 | 
			
		||||
            
 | 
			
		||||
            ${pythonEnv}/bin/pip install --target $out/lib/python3.12/site-packages \
 | 
			
		||||
              django-markdownify==0.9.5 \
 | 
			
		||||
              django-pipeline==3.1.0 \
 | 
			
		||||
              django-friendly-tag-loader==1.3.1 \
 | 
			
		||||
              django-token-bucket==0.2.4 \
 | 
			
		||||
              django-widget-tweaks==1.5.0 \
 | 
			
		||||
              libsasscompiler==0.1.9
 | 
			
		||||
            
 | 
			
		||||
            # Create wrapper script
 | 
			
		||||
            mkdir -p $out/bin
 | 
			
		||||
            cat > $out/bin/bitpoll-manage << EOF
 | 
			
		||||
            #!/bin/sh
 | 
			
		||||
            cd $out/share/bitpoll
 | 
			
		||||
            export PYTHONPATH=$out/lib/python3.12/site-packages:$out/share/bitpoll:\$PYTHONPATH
 | 
			
		||||
            export PYTHONPATH=$out/share/bitpoll:\$PYTHONPATH
 | 
			
		||||
            exec ${pythonEnv}/bin/python manage.py "\$@"
 | 
			
		||||
            EOF
 | 
			
		||||
            chmod +x $out/bin/bitpoll-manage
 | 
			
		||||
| 
						 | 
				
			
			@ -191,7 +330,7 @@
 | 
			
		|||
            cat > $out/bin/bitpoll-server << EOF
 | 
			
		||||
            #!/bin/sh
 | 
			
		||||
            cd $out/share/bitpoll
 | 
			
		||||
            export PYTHONPATH=$out/lib/python3.12/site-packages:$out/share/bitpoll:\$PYTHONPATH
 | 
			
		||||
            export PYTHONPATH=$out/share/bitpoll:\$PYTHONPATH
 | 
			
		||||
            exec ${pythonEnv}/bin/python manage.py runserver "\$@"
 | 
			
		||||
            EOF
 | 
			
		||||
            chmod +x $out/bin/bitpoll-server
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue