summaryrefslogtreecommitdiff
path: root/modules/login.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/login.nix')
-rw-r--r--modules/login.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/login.nix b/modules/login.nix
new file mode 100644
index 0000000..d2a6de3
--- /dev/null
+++ b/modules/login.nix
@@ -0,0 +1,46 @@
+{ config, lib, pkgs, ... }:
+let
+ cfg = config.orbekk.login;
+ aliases = import ../data/aliases.nix;
+in
+{
+ options = {
+ orbekk.login = {
+ enable = lib.mkEnableOption "Enable login server";
+ loginPort = lib.mkOption {
+ type = lib.types.int;
+ default = aliases.services.login.port;
+ };
+ loginDomain = lib.mkOption {
+ type = lib.types.str;
+ default = "login.orbekk.com";
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.keycloak = {
+ enable = false;
+ httpPort = "8080";
+ bindAddress = "127.0.0.1";
+ database.type = "postgresql";
+ database.passwordFile = "/opt/secret/keycloak/db_password";
+ frontendUrl = "http://localhost/auth";
+ };
+
+ environment.systemPackages = with pkgs; [
+ xmlstarlet
+ libtidy
+ jq
+ ];
+
+ # services.nginx.virtualHosts.${cfg.loginDomain} = {
+ # enableACME = true;
+ # forceSSL = true;
+ # locations."/" = {
+ # proxyPass = "http://127.0.0.1:${toString cfg.loginPort}";
+ # proxyWebsockets = true;
+ # };
+ # };
+ };
+}