add crypto

This commit is contained in:
zack 2025-07-22 20:21:21 -04:00
parent 90cbe489f6
commit af6a3bce3e
Signed by: zoey
GPG key ID: 81FB9FECDD6A33E2
120 changed files with 24616 additions and 462 deletions

View file

@ -0,0 +1,31 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.crypto;
in {
options.services.crypto = with types; {
enable = mkBoolOpt false "Enable Monero";
};
config = mkIf cfg.enable {
services.wg-container.enable = true;
systemd.services.monero.vpnConfinement = {
enable = true;
vpnNamespace = "wg";
};
services.monero = {
enable = true;
mining.enable = false;
rpc = {address = "192.168.15.1";};
extraConfig = ''
confirm-external-bind=1
'';
};
};
}

View file

@ -66,7 +66,7 @@ in {
certificateScheme = "acme-nginx";
virusScanning = true;
stateVersion = 1;
stateVersion = 3;
};
# services.nginx = {

View file

@ -0,0 +1,38 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.torrent;
in {
options.services.torrent = with types; {
enable = mkBoolOpt false "Enable Transmission Service (for Linux ISOs)";
};
config = mkIf cfg.enable {
services.wg-container.enable = true;
systemd.services.transmission.vpnConfinement = {
enable = true;
vpnNamespace = "wg";
};
services.transmission = {
enable = true;
package = pkgs.transmission_4;
settings = {
incomplete-dir-enabled = true;
rpc-bind-address = "192.168.15.1"; # Bind RPC/WebUI to VPN network namespace address
rpc-whitelist-enabled = false;
rpc-whitelist = [
"192.168.15.1"
"192.168.15.5" # Access from default network namespace
"192.168.1.*" # Access from other machines on specific subnet
"127.0.0.1" # Access through loopback within VPN network namespace
];
};
};
};
}

View file

@ -0,0 +1,50 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.services.wg-container;
in {
options.services.wg-container = with types; {
enable = mkBoolOpt false "Enable Wireguard Container";
};
config = mkIf cfg.enable {
sops = {
defaultSopsFile = ../../../.sops.yaml;
gnupg.home = "/var/lib/sops";
gnupg.sshKeyPaths = [];
secrets = {
"vpn_config_file" = {
sopsFile = ../../../../secrets/vpn-config.yaml;
owner = "root";
group = "root";
mode = "0400";
neededForUsers = true;
};
};
};
vpnNamespaces.wg = {
enable = true;
wireguardConfigFile = config.sops.secrets.vpn_config_file.path;
accessibleFrom = [
"192.168.0.0/24"
];
portMappings = [
{
from = 18081;
to = 18081;
protocol = "both";
}
{
from = 9091;
to = 9091;
}
];
};
};
}