From 02926f70770ceb90cf382da2b54f888ba969f423 Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Wed, 1 Jul 2026 00:09:21 -0400 Subject: nix based config --- nix/per-host/torrents-2/configuration.nix | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 nix/per-host/torrents-2/configuration.nix (limited to 'nix/per-host/torrents-2') diff --git a/nix/per-host/torrents-2/configuration.nix b/nix/per-host/torrents-2/configuration.nix new file mode 100644 index 0000000..6e7cd49 --- /dev/null +++ b/nix/per-host/torrents-2/configuration.nix @@ -0,0 +1,64 @@ +{ config, pkgs, modulesPath, lib, system, ... }: + +{ + config = { + sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + sops.defaultSopsFile = ../../secrets/torrents-2.yaml; + # sops.secrets."foo" = { + # owner = "transmission"; + # }; + + networking.hostName = "torrents-2"; + networking.firewall.allowedTCPPorts = [ 80 443 9091 ]; + + hardware.graphics = { + enable = true; + }; + + hardware.nvidia = { + modesetting.enable = true; + nvidiaPersistenced = true; + powerManagement.enable = false; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.legacy_580; + }; + + nixpkgs.config.allowUnfree = true; + + services.xserver.videoDrivers = [ "nvidia" ]; + + sops.templates."transmission-rpc-password.json" = { + content = '' + { + "rpc-password": "${config.sops.placeholder.foo}" + } + ''; + owner = "transmission"; + restartUnits = [ "transmission.service" ]; + }; + + services.transmission = { + enable = true; + package = pkgs.transmission_4; + credentialsFile = config.sops.templates."transmission-rpc-password.json".path; + settings = { + rpc-authentication-required = true; + rpc-username = "kdam0"; + # testpass + # rpc-password = "{b55cdbfcac290fff79d3bdb3441082dca8f278aay.bodWGn"; + # rpc-password-file = config.sops.secrets."foo".path; + rpc-bind-address = "0.0.0.0"; + # rpc-host-whitelist = "torrents2.kumardamani.net"; + rpc-whitelist-enabled = true; + rpc-whitelist = "127.0.0.1,10.10.*.*"; + }; + }; + + fileSystems."/mnt/data" = { + device = "nas.bacala:/mnt/tank/customers/kumar/media"; + fsType = "nfs"; + }; + }; +} -- cgit v1.2.3