freun.dev: add weechat
This commit is contained in:
@@ -370,5 +370,10 @@ in
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
weechat = {
|
||||||
|
enable = true;
|
||||||
|
subdomain = "irc";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,6 @@
|
|||||||
./uptime-kuma.nix
|
./uptime-kuma.nix
|
||||||
./mosquitto.nix
|
./mosquitto.nix
|
||||||
./home-assistant.nix
|
./home-assistant.nix
|
||||||
|
./weechat.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ let
|
|||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
root = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.path;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
extraConfig = lib.mkOption {
|
extraConfig = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "";
|
default = "";
|
||||||
@@ -83,9 +87,13 @@ in
|
|||||||
];
|
];
|
||||||
locations = lib.mapAttrs (
|
locations = lib.mapAttrs (
|
||||||
_:
|
_:
|
||||||
{ proxyPort, extraConfig }:
|
{
|
||||||
|
proxyPort,
|
||||||
|
extraConfig,
|
||||||
|
root,
|
||||||
|
}:
|
||||||
lib.mergeAttrsList [
|
lib.mergeAttrsList [
|
||||||
{ inherit extraConfig; }
|
{ inherit extraConfig root; }
|
||||||
(
|
(
|
||||||
if (lib.isInt proxyPort) then
|
if (lib.isInt proxyPort) then
|
||||||
{
|
{
|
||||||
|
|||||||
31
modules/services/weechat.nix
Normal file
31
modules/services/weechat.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.services.weechat;
|
||||||
|
fqdn = cfg.subdomain + "." + config.networking.domain;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.services.weechat = {
|
||||||
|
subdomain = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "The subdomain for the weechat service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services = {
|
||||||
|
weechat = {
|
||||||
|
# binary = lib.mkDefault "${pkgs.weechat}/bin/weechat-headless";
|
||||||
|
};
|
||||||
|
|
||||||
|
webserver = {
|
||||||
|
enable = lib.mkDefault true;
|
||||||
|
vHosts.${fqdn}.locations."/".root = pkgs.glowing-bear;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user