This commit is contained in:
Chris Kruining 2026-03-23 08:24:31 +01:00
parent 793866e621
commit 5b844aab8d
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
2 changed files with 53 additions and 0 deletions

View file

@ -13,6 +13,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
${namespace}.services.networking.caddy.hosts = {
"https://${config.networking.hostName}:443" = ''
reverse_proxy http://[::]:2000
'';
};
services.glance = { services.glance = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;

View file

@ -0,0 +1,47 @@
{
config,
pkgs,
lib,
namespace,
...
}: let
inherit (builtins) length;
inherit (lib) mkIf mkEnableOption mkOption types attrNames attrsToList listToAttrs;
cfg = config.${namespace}.services.networking.wireguard;
hasPeers = (cfg.peer |> attrNames |> length) > 0;
in {
options.${namespace}.services.networking.wireguard = {
# enable = mkEnableOption "enable wireguard" // {default = true;};
peer = mkOption {
type = types.attrsOf (types.submodule {
options = {
port = mkOption {
type = types.port;
description = '''';
};
address = mkOption {
type = types.listOf types.str;
default = [];
description = '''';
};
};
});
};
};
config = mkIf hasPeers {
networking.firewall.allowedUDPPorts = cfg.peer |> lib.attrValues |> lib.map (p: p.port);
networking.wq-quick = {
# enable = cfg.enable;
interfaces =
cfg.peer
|> attrsToList
|> imap0 (i: { name, value }: (namevaluepair "wg${i}" (value // { }));
|> listToAttrs
};
};
}