feat: fixed flake
This commit is contained in:
1 parent
29ed46aa7f
commit
bb13614d1e
1 file changed
+16
-15
@@ -47,11 +47,11 @@
|
||||
|
||||
nixosModules.default = { config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.services.phenix-website;
|
||||
cfg = config.services.all-dressed-programming.phenix-website;
|
||||
phenix = self.packages.${pkgs.system}.website;
|
||||
pythonEnv = pkgs.python3.withPackages (ps: [ ps.requests ]);
|
||||
in {
|
||||
options.services.phenix-website = {
|
||||
options.services.all-dressed-programming.phenix-website = {
|
||||
enable = lib.mkEnableOption "Balle Phenix website";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
@@ -65,6 +65,10 @@
|
||||
type = lib.types.path;
|
||||
default = "/var/lib/phenix";
|
||||
};
|
||||
databaseUrl = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
};
|
||||
sessionKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
@@ -87,11 +91,19 @@
|
||||
Group = "phenix";
|
||||
};
|
||||
|
||||
environment = {
|
||||
environment =
|
||||
{
|
||||
ASPNETCORE_URLS = "http://0.0.0.0:${toString cfg.port}";
|
||||
ASPNETCORE_ENVIRONMENT = "Production";
|
||||
}
|
||||
// lib.optionalAttrs (cfg.databaseUrl == "") {
|
||||
ConnectionStrings__Default = "Data Source=${cfg.dataDir}/phenix.db";
|
||||
} // lib.optionalAttrs (cfg.sessionKey != "") {
|
||||
}
|
||||
// lib.optionalAttrs (cfg.databaseUrl != "") {
|
||||
DatabaseProvider = "Postgres";
|
||||
ConnectionStrings__Default = cfg.databaseUrl;
|
||||
}
|
||||
// lib.optionalAttrs (cfg.sessionKey != "") {
|
||||
SessionKey = cfg.sessionKey;
|
||||
};
|
||||
|
||||
@@ -109,17 +121,6 @@
|
||||
|
||||
users.groups.phenix = {};
|
||||
|
||||
services.nginx = lib.mkIf (cfg.domain != "") {
|
||||
enable = true;
|
||||
virtualHosts.${cfg.domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}";
|
||||
proxyWebsockets = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user