diff --git a/configuration.nix b/configuration.nix index 1540f8d..9ea7b67 100644 --- a/configuration.nix +++ b/configuration.nix @@ -150,6 +150,8 @@ powertop + lsof + (pkgs.writeShellApplication { name = "disk-smart-test"; runtimeInputs = with pkgs; [ diff --git a/flake.lock b/flake.lock index b4ff989..0cbe7c6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1731098351, - "narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=", + "lastModified": 1741148495, + "narHash": "sha256-EV8KUaIZ2/CdBXlutXrHoZYbWPeB65p5kKZk71gvDRI=", "owner": "ipetkov", "repo": "crane", - "rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28", + "rev": "75390a36cd0c2cdd5f1aafd8a9f827d7107f2e53", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1740485968, - "narHash": "sha256-WK+PZHbfDjLyveXAxpnrfagiFgZWaTJglewBWniTn2Y=", + "lastModified": 1741786315, + "narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=", "owner": "nix-community", "repo": "disko", - "rev": "19c1140419c4f1cdf88ad4c1cfb6605597628940", + "rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de", "type": "github" }, "original": { @@ -38,11 +38,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -75,11 +75,11 @@ ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1740872218, + "narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "3876f6b87db82f33775b1ef5ea343986105db764", "type": "github" }, "original": { @@ -161,11 +161,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1740440383, - "narHash": "sha256-w8ixbqOGrVWMQZFFs4uAwZpuwuGMzFoKjocMFxTR5Ts=", + "lastModified": 1741442524, + "narHash": "sha256-tVcxLDLLho8dWcO81Xj/3/ANLdVs0bGyCPyKjp70JWk=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "6321bc060d757c137c1fbae2057c7e941483878f", + "rev": "d8099586d9a84308ffedac07880e7f07a0180ff4", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1740707367, - "narHash": "sha256-MK8KXbsLgLju27AnP86f8tsC8oZWXCwlfS6n6Vi3U1U=", + "lastModified": 1742003385, + "narHash": "sha256-c9gUL+HaIth47YUZTiXgG3NDhaxriJxHM7a0TEXAuBQ=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "cb6a182ec450063d73a78450344dbb6684842117", + "rev": "9f51cce843d03d7456b535aeabca87db1012da2c", "type": "github" }, "original": { @@ -198,11 +198,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1740646007, - "narHash": "sha256-dMReDQobS3kqoiUCQIYI9c0imPXRZnBubX20yX/G5LE=", + "lastModified": 1741792691, + "narHash": "sha256-f0BVt1/cvA0DQ/q3rB+HY4g4tKksd03ZkzI4xehC2Ew=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "009b764ac98a3602d41fc68072eeec5d24fc0e49", + "rev": "e1f12151258b12c567f456d8248e4694e9390613", "type": "github" }, "original": { @@ -214,11 +214,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740603184, - "narHash": "sha256-t+VaahjQAWyA+Ctn2idyo1yxRIYpaDxMgHkgCNiMJa4=", + "lastModified": 1741862977, + "narHash": "sha256-prZ0M8vE/ghRGGZcflvxCu40ObKaB+ikn74/xQoNrGQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f44bd8ca21e026135061a0a57dcf3d0775b67a49", + "rev": "cdd2ef009676ac92b715ff26630164bb88fec4e0", "type": "github" }, "original": { @@ -244,22 +244,6 @@ "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1730741070, - "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -270,15 +254,14 @@ "nixpkgs": [ "lanzaboote", "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable" + ] }, "locked": { - "lastModified": 1731363552, - "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "lastModified": 1740915799, + "narHash": "sha256-JvQvtaphZNmeeV+IpHgNdiNePsIpHD5U/7QN5AeY44A=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "rev": "42b1ba089d2034d910566bf6b40830af6b8ec732", "type": "github" }, "original": { @@ -307,11 +290,11 @@ ] }, "locked": { - "lastModified": 1731897198, - "narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=", + "lastModified": 1741228283, + "narHash": "sha256-VzqI+k/eoijLQ5am6rDFDAtFAbw8nltXfLBC6SIEJAE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "0be641045af6d8666c11c2c40e45ffc9667839b5", + "rev": "38e9826bc4296c9daf18bc1e6aa299f3e932a403", "type": "github" }, "original": { @@ -337,11 +320,11 @@ }, "vpn-confinement": { "locked": { - "lastModified": 1731209328, - "narHash": "sha256-b3jggBHZh20jUfBxoaIvew23czsw82zBc0aKxtkF3g8=", + "lastModified": 1740921534, + "narHash": "sha256-orXe3m04DLTW3I19VVanClzpqeq7adnDTqKAD7aPbA8=", "owner": "Maroka-chan", "repo": "VPN-Confinement", - "rev": "74e6fd47804b5ca69187200efbb14cf1ecb9ea07", + "rev": "5eb7dc3e901f4dbb085eb37f5785473a9ae78bc4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e43f6b8..89d851c 100644 --- a/flake.nix +++ b/flake.nix @@ -49,9 +49,10 @@ eth_interface = "enp4s0"; service_configs = rec { - zpool = "tank"; - hdd_path = "/mnt/hdd"; - services_dir = "/${zpool}/services"; + zpool_ssds = "tank"; + zpool_hdds = "hdds"; + torrents_path = "/torrents"; + services_dir = "/${zpool_ssds}/services"; torrent_group = "media"; # TODO: add checks to make sure none of these collide @@ -93,8 +94,8 @@ }; torrent = { - SavePath = hdd_path + "/torrents"; - TempPath = hdd_path + "/torrents/incomplete"; + SavePath = torrents_path; + TempPath = torrents_path + "/incomplete"; }; jellyfin = { diff --git a/hardware.nix b/hardware.nix index bdaa6b7..16dc8b5 100644 --- a/hardware.nix +++ b/hardware.nix @@ -17,12 +17,6 @@ boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - # 3tb HDD - fileSystems.${service_configs.hdd_path} = { - device = "/dev/disk/by-uuid/f69b8c84-20ca-448f-b580-8951f20b9fc1"; - fsType = "xfs"; - }; - swapDevices = [ ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/services/minecraft.nix b/services/minecraft.nix index 7adc9dd..d54c1fe 100644 --- a/services/minecraft.nix +++ b/services/minecraft.nix @@ -51,8 +51,8 @@ in with pkgs; builtins.attrValues { FabricApi = fetchurl { - url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/ZNwYCTsk/fabric-api-0.118.0%2B1.21.4.jar"; - sha512 = "1e0d31b6663dc2c7be648f3a5a9cf7b698b9a0fd0f7ae16d1d3f32d943d7c5205ff63a4f81b0c4e94a8997482cce026b7ca486e99d9ce35ac069aeb29b02a30d"; + url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/IXeiAH6H/fabric-api-0.118.5%2B1.21.4.jar"; + sha512 = "5ad7b91f3077fdd412d30b08cc93ddb625b281c3dc39b7ca24957901931807695fda045c040990e1bdd741c5bf384f21fb8c136a04ab1fb99a08b38d361fba6b"; }; FerriteCore = fetchurl { diff --git a/services/qbittorrent.nix b/services/qbittorrent.nix index eeaf219..b7aef5a 100644 --- a/services/qbittorrent.nix +++ b/services/qbittorrent.nix @@ -35,8 +35,8 @@ WebUI = { AlternativeUIEnabled = true; RootFolder = "${pkgs.fetchzip { - url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.22.0/vuetorrent.zip"; - sha256 = "UJflyTyftWSIOi942OgH/tvylyAeo6EjR14U0SHk6bs="; + url = "https://github.com/VueTorrent/VueTorrent/releases/download/v2.23.0/vuetorrent.zip"; + sha256 = "GCrKmv1jvN6bZb3s5E96KE3PsJ3ju63sVfCtU1RF/u8="; }}"; # disable auth because we use caddy for auth @@ -52,15 +52,14 @@ serverConfig.BitTorrent = { Session = { - GlobalUPSpeedLimit = 500; # in KiB/s - GlobalDLSpeedLimit = 0; + GlobalUPSpeedLimit = 500; # 500 KiB/s + GlobalDLSpeedLimit = 5000; # 5 MiB/s + IgnoreLimitsOnLAN = true; - # Including overhead in limits ruins download because download - # uses upload to communicate with seeders - IncludeOverheadInLimits = false; + IncludeOverheadInLimits = true; - GlobalMaxRatio = 4; + GlobalMaxRatio = -1; QueueingSystemEnabled = false; # seed all torrents all the time AddTrackersEnabled = true; @@ -73,11 +72,7 @@ "udp://tracker.dler.org:6969/announce" "udp://tracker.bittor.pw:1337/announce" "udp://tracker.torrent.eu.org:451/announce" - # "udp://opentracker.i2p.rocks:6969/announce" - # "udp://tracker.openbittorrent.com:6969/announce" - # "udp://aarsen.me:6969/announce" "udp://explodie.org:6969/announce" - # "udp://uploads.gamecoast.net:6969/announce" "http://tracker.files.fm:6969/announce" "udp://tracker.tiny-vps.com:6969/announce" "udp://p4p.arenabg.com:1337/announce" diff --git a/zfs.nix b/zfs.nix index fe8cef1..b401255 100644 --- a/zfs.nix +++ b/zfs.nix @@ -24,21 +24,24 @@ in ]; boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.extraPools = [ service_configs.zpool ]; + boot.zfs.extraPools = [ + service_configs.zpool_ssds + service_configs.zpool_hdds + ]; services.sanoid = { enable = true; - datasets."${service_configs.zpool}" = { + datasets."${service_configs.zpool_ssds}" = { recursive = true; autoprune = true; autosnap = true; - hourly = 24; - daily = 30; - monthly = 12; - yearly = 4; + hourly = 5; + daily = 7; + monthly = 3; + yearly = 0; }; - datasets."${service_configs.zpool}/services/sql" = { + datasets."${service_configs.zpool_ssds}/services/sql" = { recursive = true; autoprune = true; autosnap = true; @@ -47,6 +50,26 @@ in monthly = 0; yearly = 0; }; + + datasets."${service_configs.zpool_ssds}/services/jellyfin_cache" = { + recursive = true; + autoprune = true; + autosnap = true; + hourly = 0; + daily = 0; + monthly = 0; + yearly = 0; + }; + + datasets."${service_configs.zpool_hdds}" = { + recursive = true; + autoprune = true; + autosnap = true; + hourly = 0; + daily = 0; + monthly = 0; + yearly = 0; + }; }; services.zfs = {