parent
83fe089c5e
commit
98833bdc6f
14 changed files with 367 additions and 46 deletions
configurations/cluster/modules
|
@ -1,36 +1,37 @@
|
|||
{
|
||||
caddy-plugins,
|
||||
config,
|
||||
lib,
|
||||
mainUser,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) attrValues;
|
||||
|
||||
inherit (config.sops) secrets;
|
||||
inherit (config.networking) hostName;
|
||||
|
||||
caddy = caddy-plugins.packages.${pkgs.system}.default;
|
||||
in {
|
||||
imports = [caddy-plugins.nixosModules.default];
|
||||
imports = [self.nixosModules.caddy-plus];
|
||||
|
||||
# User stuff
|
||||
environment.systemPackages = [caddy];
|
||||
users.users.${mainUser}.extraGroups = ["caddy"];
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.ip_nonlocal_bind" = 1;
|
||||
|
||||
systemd.services.caddy.serviceConfig = {
|
||||
EnvironmentFile = secrets.caddy-cloudflare.path;
|
||||
|
||||
# For some reason the service
|
||||
# doesn't shutdown normally
|
||||
KillSignal = "SIGKILL";
|
||||
RestartKillSignal = "SIGKILL";
|
||||
};
|
||||
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
enableReload = false;
|
||||
package = caddy;
|
||||
|
||||
package = let
|
||||
pluginsInfo = import ./plugins.nix;
|
||||
in
|
||||
pkgs.caddy.withPlugins {
|
||||
plugins = map (x: "${x.url}@${x.version}") (attrValues pluginsInfo.plugins);
|
||||
inherit (pluginsInfo) hash;
|
||||
};
|
||||
|
||||
virtualHosts = let
|
||||
clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip;
|
11
configurations/cluster/modules/caddy/plugins.nix
Normal file
11
configurations/cluster/modules/caddy/plugins.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
# This file was autogenerated. DO NOT EDIT!
|
||||
{
|
||||
plugins = {
|
||||
cloudflare = {
|
||||
url = "github.com/caddy-dns/cloudflare";
|
||||
version = "v0.0.0-20240703190432-89f16b99c18e";
|
||||
};
|
||||
};
|
||||
|
||||
hash = "sha256-WGV/Ve7hbVry5ugSmTYWDihoC9i+D3Ct15UKgdpYc9U=";
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./blocky.nix
|
||||
./caddy.nix
|
||||
./caddy
|
||||
./headscale
|
||||
./nfs-client.nix
|
||||
./pcsd.nix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue