init project
This commit is contained in:
parent
a26fa2c64a
commit
dc0440fcef
291 changed files with 124865 additions and 485 deletions
40
flake.nix
40
flake.nix
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
description = "fragify package and service";
|
||||
description = "fragdenrat package and service";
|
||||
|
||||
inputs.nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||
|
||||
|
|
@ -16,52 +16,60 @@
|
|||
);
|
||||
in {
|
||||
overlay = final: prev: {
|
||||
fragify = with final; python3Packages.buildPythonApplication rec {
|
||||
pname = "fragify";
|
||||
version = "0.0.1";
|
||||
fragdenrat = with final; python3Packages.buildPythonApplication rec {
|
||||
pname = "fragdenrat";
|
||||
version = "0.1.0";
|
||||
format = "other";
|
||||
|
||||
src = self;
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
dependencies = with python3Packages; [ falcon requests jinja2 ];
|
||||
dependencies = with python3Packages; [ django requests jinja2 ];
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 ${./fragify.py} $out/bin/fragify
|
||||
mkdir -p $out/share/fragify
|
||||
cp -r ${./templates} $out/share/fragify/templates
|
||||
# Provide a WSGI entry file for uWSGI to load
|
||||
install -Dm644 ${./fragify.py} $out/share/fragify/fragify_wsgi.py
|
||||
# Install built assets if present
|
||||
mkdir -p $out/share/fragdenrat
|
||||
# Project code
|
||||
cp -r ${./fragdenrat} $out/share/fragdenrat/
|
||||
# Django manage helper
|
||||
install -Dm755 ${./manage.py} $out/bin/fragdenrat-manage
|
||||
# Templates and static assets
|
||||
if [ -d ./templates ]; then
|
||||
cp -r ./templates $out/share/fragdenrat/
|
||||
fi
|
||||
if [ -d ./assets ]; then
|
||||
cp -r ./assets $out/share/fragify/
|
||||
cp -r ./assets $out/share/fragdenrat/
|
||||
fi
|
||||
'';
|
||||
|
||||
passthru.pythonPath = python3Packages.makePythonPath dependencies;
|
||||
|
||||
meta.mainProgram = "fragify";
|
||||
meta.mainProgram = "fragdenrat-manage";
|
||||
};
|
||||
};
|
||||
|
||||
packages = forAllSystems (system: {
|
||||
inherit (nixpkgsFor.${system}) fragify;
|
||||
inherit (nixpkgsFor.${system}) fragdenrat;
|
||||
});
|
||||
|
||||
defaultPackage = forAllSystems (system: self.packages.${system}.fragify);
|
||||
defaultPackage = forAllSystems (system: self.packages.${system}.fragdenrat);
|
||||
|
||||
devShells = forAllSystems (system: let
|
||||
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; with python3Packages; [
|
||||
python
|
||||
django
|
||||
requests
|
||||
beautifulsoup4
|
||||
];
|
||||
shellHook = ''
|
||||
export DJANGO_SETTINGS_MODULE=fragdenrat.settings
|
||||
export PYTHONPATH=$PWD:$PYTHONPATH
|
||||
'';
|
||||
});
|
||||
|
||||
# fragify service module
|
||||
# fragdenrat service module
|
||||
nixosModule = (import ./module.nix);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue