forked from Fediversity/Fediversity
minimum setup i got working for deployment
This commit is contained in:
parent
1d4004ccf4
commit
f828afd5d5
2 changed files with 19 additions and 4 deletions
|
@ -29,7 +29,7 @@ in
|
||||||
secrets = {
|
secrets = {
|
||||||
SECRET_KEY = config.age.secrets.panel-secret-key.path;
|
SECRET_KEY = config.age.secrets.panel-secret-key.path;
|
||||||
};
|
};
|
||||||
port = 80;
|
port = 8000;
|
||||||
settings = {
|
settings = {
|
||||||
DATABASE_URL = "sqlite:///var/lib/${name}/db.sqlite3";
|
DATABASE_URL = "sqlite:///var/lib/${name}/db.sqlite3";
|
||||||
CREDENTIALS_DIRECTORY = "/var/lib/${name}/.credentials";
|
CREDENTIALS_DIRECTORY = "/var/lib/${name}/.credentials";
|
||||||
|
|
|
@ -26,10 +26,19 @@ let
|
||||||
database-url = "sqlite:////var/lib/${name}/db.sqlite3";
|
database-url = "sqlite:////var/lib/${name}/db.sqlite3";
|
||||||
|
|
||||||
python-environment = pkgs.python3.withPackages (
|
python-environment = pkgs.python3.withPackages (
|
||||||
ps: with ps; [
|
ps:
|
||||||
cfg.package
|
with ps;
|
||||||
|
[
|
||||||
uvicorn
|
uvicorn
|
||||||
|
cfg.package
|
||||||
|
dj-database-url
|
||||||
|
django-compressor
|
||||||
|
django-debug-toolbar
|
||||||
|
django-libsass
|
||||||
|
django_4
|
||||||
|
setuptools
|
||||||
]
|
]
|
||||||
|
++ cfg.package.propagatedBuildInputs
|
||||||
);
|
);
|
||||||
|
|
||||||
configFile = pkgs.concatText "configuration.py" [
|
configFile = pkgs.concatText "configuration.py" [
|
||||||
|
@ -180,7 +189,8 @@ in
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
script = ''
|
script = ''
|
||||||
uvicorn ${name}.asgi:application --host ${cfg.host} --port ${toString cfg.port}
|
export PYTHONPATH=$PYTHONPATH:${cfg.package}/lib/python3.12/site-packages
|
||||||
|
${python-environment}/bin/python -m uvicorn ${name}.asgi:application --host ${cfg.host} --port ${toString cfg.port}
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
@ -195,5 +205,10 @@ in
|
||||||
DATABASE_URL = database-url;
|
DATABASE_URL = database-url;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue