bedjet
This commit is contained in:
@@ -234,6 +234,7 @@ in
|
|||||||
# /packages
|
# /packages
|
||||||
pkgs.${namespace}.ha-anycubic
|
pkgs.${namespace}.ha-anycubic
|
||||||
pkgs.${namespace}.ha-bambulab
|
pkgs.${namespace}.ha-bambulab
|
||||||
|
pkgs.${namespace}.ha-bedjet
|
||||||
pkgs.${namespace}.ha-gehome
|
pkgs.${namespace}.ha-gehome
|
||||||
pkgs.${namespace}.ha-icloud3
|
pkgs.${namespace}.ha-icloud3
|
||||||
pkgs.${namespace}.ha-mail-and-packages
|
pkgs.${namespace}.ha-mail-and-packages
|
||||||
|
|||||||
82
modules/nixos/services/matrix/default.nix.conduit
Normal file
82
modules/nixos/services/matrix/default.nix.conduit
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
{ config, lib, namespace, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib.${namespace}) mkOpt mkReverseProxyOpt;
|
||||||
|
cfg = config.${namespace}.services.matrix;
|
||||||
|
|
||||||
|
matrixConfig = {
|
||||||
|
services = {
|
||||||
|
matrix-conduit = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
server_name = "mjallen.dev";
|
||||||
|
address = "0.0.0.0";
|
||||||
|
port = cfg.port;
|
||||||
|
allow_registration = false;
|
||||||
|
well_known = {
|
||||||
|
client = "https://matrix.mjallen.dev";
|
||||||
|
server = "matrix.mjallen.dev:443";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [ cfg.port 8448 ];
|
||||||
|
allowedUDPPorts = [ cfg.port 8448 ];
|
||||||
|
};
|
||||||
|
# Use systemd-resolved inside the container
|
||||||
|
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
|
||||||
|
useHostResolvConf = lib.mkForce false;
|
||||||
|
};
|
||||||
|
services.resolved.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
bindMounts = {
|
||||||
|
"/var/lib" = {
|
||||||
|
hostPath = cfg.dataDir;
|
||||||
|
isReadOnly = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Create reverse proxy configuration using mkReverseProxy
|
||||||
|
reverseProxyConfig = lib.${namespace}.mkReverseProxy {
|
||||||
|
name = "matrix";
|
||||||
|
subdomain = cfg.reverseProxy.subdomain;
|
||||||
|
url = "http://${cfg.localAddress}:${toString cfg.port}";
|
||||||
|
middlewares = cfg.reverseProxy.middlewares;
|
||||||
|
};
|
||||||
|
|
||||||
|
matrixContainer = (lib.${namespace}.mkContainer {
|
||||||
|
name = "matrix-conduit";
|
||||||
|
localAddress = cfg.localAddress;
|
||||||
|
port = cfg.port;
|
||||||
|
bindMounts = bindMounts;
|
||||||
|
config = matrixConfig;
|
||||||
|
}) { inherit lib; };
|
||||||
|
|
||||||
|
fullConfig = {
|
||||||
|
${namespace}.services.traefik = lib.mkIf cfg.reverseProxy.enable {
|
||||||
|
reverseProxies = [ reverseProxyConfig ];
|
||||||
|
};
|
||||||
|
} // matrixContainer;
|
||||||
|
in
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.${namespace}.services.matrix = {
|
||||||
|
enable = mkEnableOption "matrix service";
|
||||||
|
|
||||||
|
port = mkOpt types.int 8008 "Port for Actual to be hosted on";
|
||||||
|
|
||||||
|
localAddress = mkOpt types.str "127.0.0.1" "local address of the service";
|
||||||
|
|
||||||
|
dataDir = mkOpt types.str "" "Path to the data dir";
|
||||||
|
|
||||||
|
reverseProxy = mkReverseProxyOpt;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable fullConfig;
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
buildHomeAssistantComponent,
|
buildHomeAssistantComponent,
|
||||||
python3Packages,
|
python3Packages,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
buildHomeAssistantComponent rec {
|
buildHomeAssistantComponent rec {
|
||||||
@@ -14,7 +13,7 @@ buildHomeAssistantComponent rec {
|
|||||||
owner = owner;
|
owner = owner;
|
||||||
repo = "ha-bedjet";
|
repo = "ha-bedjet";
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = lib.fakeHash;
|
hash = "sha256-rjn9dUM6Tntps2KECdHCdp1FhFg1uEaByXFlrwn4AAU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = with python3Packages; [
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
|||||||
Reference in New Issue
Block a user