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} = {
|
||||
bundles = {
|
||||
common = enabled;
|
||||
server = enabled;
|
||||
};
|
||||
services = {
|
||||
networking = {
|
||||
httpd = enabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
storage = {
|
||||
nfs = {
|
||||
enable = true;
|
||||
|
|
@ -38,11 +36,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "chibi";
|
||||
hostId = "9245f27e";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ in {
|
|||
${namespace} = {
|
||||
bundles = {
|
||||
common = enabled;
|
||||
server = enabled;
|
||||
};
|
||||
|
||||
services = {
|
||||
|
|
@ -27,7 +28,6 @@ in {
|
|||
"*.cpatino.com"
|
||||
];
|
||||
};
|
||||
httpd = enabled;
|
||||
};
|
||||
storage = {
|
||||
nfs.mounts = {
|
||||
|
|
@ -40,11 +40,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "shiori";
|
||||
hostId = "1a4ecbe3";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ in {
|
|||
${namespace} = {
|
||||
bundles = {
|
||||
common = enabled;
|
||||
server = enabled;
|
||||
};
|
||||
|
||||
hardware = {
|
||||
|
|
@ -36,10 +37,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
httpd = enabled;
|
||||
};
|
||||
|
||||
storage = {
|
||||
samba.mounts = {
|
||||
shared = {
|
||||
|
|
@ -57,11 +54,6 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
clean.enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "tsuki";
|
||||
hostId = "3d19e767";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue