Skip to content

Instantly share code, notes, and snippets.

@jhh
Created December 6, 2024 16:15
Show Gist options
  • Save jhh/14e11439a521082486d727962a4c9cb0 to your computer and use it in GitHub Desktop.
Save jhh/14e11439a521082486d727962a4c9cb0 to your computer and use it in GitHub Desktop.
django-static-roots
staticRoots = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) stdenv;
pythonSet = pythonSets.${system};
venv = pythonSet.mkVirtualEnv "upkeep-env" workspace.deps.default;
in
stdenv.mkDerivation {
name = "upkeep-static";
# version = ?;
inherit (pythonSet.upkeep) src;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [
venv
];
installPhase = ''
export DJANGO_STATICFILES_DIR="${self.packages.${system}.bundle}"
export DJANGO_STATIC_ROOT="$out"
upkeep-manage collectstatic
'';
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment