trivios: add web services
This commit is contained in:
parent
5d0bebaefb
commit
bdb02a607c
|
@ -10,6 +10,7 @@
|
|||
imports = [
|
||||
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
|
||||
(modulesPath + "/profiles/minimal.nix")
|
||||
./web.nix
|
||||
];
|
||||
|
||||
disabledModules = [
|
||||
|
@ -31,7 +32,6 @@
|
|||
hardware.enableRedistributableFirmware = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
libraspberrypi
|
||||
(python3.withPackages (py: [ py.django ]))
|
||||
];
|
||||
networking.wireless.enable = true;
|
||||
networking.hostName = "tripi";
|
||||
|
|
35
triviOS/web.nix
Normal file
35
triviOS/web.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, pkgs, ... }: {
|
||||
config.services = {
|
||||
nginx = {
|
||||
enable = true;
|
||||
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
|
||||
virtualHosts.home-manager = {
|
||||
default = true;
|
||||
|
||||
locations = {
|
||||
"/".extraConfig = ''
|
||||
uwsgi_pass unix://${config.services.uwsgi.runDir}/uwsgi.sock;
|
||||
include uwsgi_params;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uwsgi = {
|
||||
enable = true;
|
||||
group = "nginx";
|
||||
plugins = [ "python3" ];
|
||||
|
||||
instance = {
|
||||
type = "normal";
|
||||
pythonPackages = py: [ py.callPackage ../ui { } ];
|
||||
|
||||
module = "homemanager.wsgi";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
9
ui/default.nix
Normal file
9
ui/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ buildPythonPackage, django_4 }:
|
||||
buildPythonPackage {
|
||||
pname = "homemanager";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
|
||||
propagatedBuildInputs = [ django_4 ];
|
||||
}
|
Loading…
Reference in a new issue