refactor: bundle server-specific config with httpd, fail2ban, and nh auto-clean
All checks were successful
ci / treefmt (push) Successful in 2m6s
All checks were successful
ci / treefmt (push) Successful in 2m6s
This commit is contained in:
parent
019c5802de
commit
e7cf807f02
4 changed files with 38 additions and 24 deletions
34
modules/nixos/bundles/server/default.nix
Normal file
34
modules/nixos/bundles/server/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
namespace,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf mkEnableOption;
|
||||||
|
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace enabled;
|
||||||
|
base = "${namespace}.bundles.server";
|
||||||
|
cfg = getAttrByNamespace config base;
|
||||||
|
in {
|
||||||
|
options = mkOptionsWithNamespace base {
|
||||||
|
enable = mkEnableOption "server bundle";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
${namespace} = {
|
||||||
|
services = {
|
||||||
|
networking = {
|
||||||
|
httpd = enabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
security = {
|
||||||
|
fail2ban = enabled;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nh = {
|
||||||
|
enable = true;
|
||||||
|
clean.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -17,12 +17,10 @@ in {
|
||||||
${namespace} = {
|
${namespace} = {
|
||||||
bundles = {
|
bundles = {
|
||||||
common = enabled;
|
common = enabled;
|
||||||
|
server = enabled;
|
||||||
};
|
};
|
||||||
services = {
|
|
||||||
networking = {
|
|
||||||
httpd = enabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
services = {
|
||||||
storage = {
|
storage = {
|
||||||
nfs = {
|
nfs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -38,11 +36,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nh = {
|
|
||||||
enable = true;
|
|
||||||
clean.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "chibi";
|
hostName = "chibi";
|
||||||
hostId = "9245f27e";
|
hostId = "9245f27e";
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ in {
|
||||||
${namespace} = {
|
${namespace} = {
|
||||||
bundles = {
|
bundles = {
|
||||||
common = enabled;
|
common = enabled;
|
||||||
|
server = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
@ -27,7 +28,6 @@ in {
|
||||||
"*.cpatino.com"
|
"*.cpatino.com"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
httpd = enabled;
|
|
||||||
};
|
};
|
||||||
storage = {
|
storage = {
|
||||||
nfs.mounts = {
|
nfs.mounts = {
|
||||||
|
|
@ -40,11 +40,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nh = {
|
|
||||||
enable = true;
|
|
||||||
clean.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "shiori";
|
hostName = "shiori";
|
||||||
hostId = "1a4ecbe3";
|
hostId = "1a4ecbe3";
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ in {
|
||||||
${namespace} = {
|
${namespace} = {
|
||||||
bundles = {
|
bundles = {
|
||||||
common = enabled;
|
common = enabled;
|
||||||
|
server = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
|
|
@ -36,10 +37,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
|
||||||
httpd = enabled;
|
|
||||||
};
|
|
||||||
|
|
||||||
storage = {
|
storage = {
|
||||||
samba.mounts = {
|
samba.mounts = {
|
||||||
shared = {
|
shared = {
|
||||||
|
|
@ -57,11 +54,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nh = {
|
|
||||||
enable = true;
|
|
||||||
clean.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "tsuki";
|
hostName = "tsuki";
|
||||||
hostId = "3d19e767";
|
hostId = "3d19e767";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue