modules.services.peerBanHelper: init

This commit is contained in:
2025-08-21 08:10:30 +08:00
parent 38641ff593
commit 043050a491
3 changed files with 29 additions and 0 deletions

View File

@@ -103,6 +103,7 @@ inputs:
keyd = {};
kvm.aarch64 = true;
nfs."/" = [ "192.168.84.0/24" ];
peerBanHelper = {};
};
bugs = [ "xmunet" "backlight" "amdpstate" "iwlwifi" ];
packages = { mathematica = {}; vasp = {}; };

View File

@@ -204,4 +204,16 @@
name = "guix.iso";
sha256 = "0xqabnay8wwqc1a96db8ix1a6bhvgm84s5is1q67rr432q7gqgd4";
};
peerBanHelper =
{
image = "ghostchu/peerbanhelper:v8.0.12";
imageFile = pkgs.dockerTools.pullImage
{
imageName = "ghostchu/peerbanhelper";
imageDigest = "sha256:fce7047795fe1e6d730ea2583b390ccc336e79eb2d8dae8114f4f63f00208879";
hash = "sha256-7Z2ewDpGFXyvCze9HZ7KwFwn9o9R6Y4pjJDcr5Wmy1g=";
finalImageName = "ghostchu/peerbanhelper";
finalImageTag = "v8.0.12";
};
};
}

View File

@@ -0,0 +1,16 @@
inputs:
{
options.nixos.services.peerBanHelper = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) peerBanHelper; in inputs.lib.mkIf (peerBanHelper != null)
{
virtualisation.oci-containers.containers.peerBanHelper =
{
inherit (inputs.topInputs.self.src.peerBanHelper) image imageFile;
volumes = [ "peerBanHelper:/app/data" ];
ports = [ "9898:9898/tcp" ];
environment = { PUID = "0"; PGID = "0"; TZ = "UTC"; };
};
nixos.services.podman = {};
};
}