This commit is contained in:
Robin Appelman 2026-03-26 16:45:18 +01:00
commit fbb10546a9
9 changed files with 778 additions and 413 deletions

1098
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2,26 +2,27 @@
name = "tasproxy"
version = "0.1.0"
authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2018"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://codeberg.org/icewind/tasproxy"
rust-version = "1.85.0"
[dependencies]
rumqttc = "0.24.0"
tokio = { version = "1.41.0", features = ["macros", "rt-multi-thread", "signal"] }
futures-util = "0.3.31"
rumqttc = "0.25.1"
tokio = { version = "1.50.0", features = ["macros", "rt-multi-thread", "signal"] }
futures-util = "0.3.32"
dashmap = "6.1.0"
json = "0.12.4"
warp = "0.3.7"
dotenv = "0.15.0"
color-eyre = "0.6.3"
color-eyre = "0.6.5"
async-stream = "0.3.6"
pin-utils = "0.1.0"
hostname = "0.4.0"
hostname = "0.4.2"
warp-reverse-proxy = { version = "1.0.0", default-features = false, features = ["rustls-tls"] }
tokio-stream = { version = "0.1.16", features = ["net"] }
tokio-stream = { version = "0.1.18", features = ["net"] }
base64 = "0.22.1"
secretfile = "0.1.0"
serde = { version = "1.0.213", features = ["derive"] }
toml = "0.8.19"
clap = { version = "4.5.20", features = ["derive"] }
secretfile = "0.1.1"
serde = { version = "1.0.228", features = ["derive"] }
toml = "1.1.0"
clap = { version = "4.6.0", features = ["derive"] }

34
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
"lastModified": 1742394900,
"narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=",
"lastModified": 1774313767,
"narHash": "sha256-hy0XTQND6avzGEUFrJtYBBpFa/POiiaGBr2vpU6Y9tY=",
"owner": "ipetkov",
"repo": "crane",
"rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd",
"rev": "3d9df76e29656c679c744968b17fbaf28f0e923d",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
]
},
"locked": {
"lastModified": 1748868585,
"narHash": "sha256-DrrbahOQAwvNM8l5EuGxxkVS7X5/S59zcG0N9ZWQFhk=",
"lastModified": 1774271954,
"narHash": "sha256-FbvMOykx7f7uEPdRVzUSABnLjqCdEp22wa0nDkuEd3s=",
"owner": "nix-community",
"repo": "flakelight",
"rev": "dfbecd12d99c1bf82906521a6a7d5b75d2aa1ca2",
"rev": "c90878b309508083094f465d6aa11b3963f48b9f",
"type": "github"
},
"original": {
@ -44,11 +44,11 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1748205441,
"narHash": "sha256-W+UUBT/l1DSTZo5G43494mRNNspJ2i9jW2QELC9JuMQ=",
"lastModified": 1774538603,
"narHash": "sha256-IG0fOFNUjselW61zc/jOZU3abmt7FjcRdES9SXeHun4=",
"ref": "refs/heads/main",
"rev": "dac3b74a89cebbeb21cc6602e4a346604adbee8b",
"revCount": 49,
"rev": "0ef9ce3384617243e1b9e94a7057f879f621f014",
"revCount": 69,
"type": "git",
"url": "https://codeberg.org/icewind/mill-scale"
},
@ -59,16 +59,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1748708770,
"narHash": "sha256-q8jG2HJWgooWa9H0iatZqBPF3bp0504e05MevFmnFLY=",
"lastModified": 1774388614,
"narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a59eb7800787c926045d51b70982ae285faa2346",
"rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"type": "indirect"
}
},
@ -88,11 +88,11 @@
]
},
"locked": {
"lastModified": 1742697269,
"narHash": "sha256-Lpp0XyAtIl1oGJzNmTiTGLhTkcUjwSkEb0gOiNzYFGM=",
"lastModified": 1774535687,
"narHash": "sha256-dpKS/8+uB0EoI4mCrpio+xs8Xxry6ZhLLwV8VIbbfrs=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "01973c84732f9275c50c5f075dd1f54cc04b3316",
"rev": "75900435aa883f84b038316864b3f60956681523",
"type": "github"
},
"original": {

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05";
nixpkgs.url = "nixpkgs/nixos-25.11";
flakelight = {
url = "github:nix-community/flakelight";
inputs.nixpkgs.follows = "nixpkgs";
@ -13,11 +13,13 @@
outputs = {mill-scale, ...}:
mill-scale ./. {
packages = {
tasproxy = import ./package.nix;
docker = import ./docker.nix;
tasproxy = pkgs: pkgs.tasproxy;
docker = pkgs: pkgs.docker;
};
withOverlays = import ./overlay.nix;
withOverlays = [
(import ./nix/overlay.nix)
];
nixosModules = {outputs, ...}: {
default = {
@ -26,9 +28,9 @@
lib,
...
}: {
imports = [./module.nix];
imports = [./nix/module.nix];
config = lib.mkIf config.services.tasproxy.enable {
nixpkgs.overlays = [(import ./overlay.nix)];
nixpkgs.overlays = [(import ./nix/overlay.nix)];
services.tasproxy.package = lib.mkDefault pkgs.tasproxy;
};
};

20
nix/package.nix Normal file
View file

@ -0,0 +1,20 @@
{
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
version = (fromTOML (readFile ../Cargo.toml)).package.version;
in
rustPlatform.buildRustPackage rec {
pname = "tasproxy";
inherit src version;
cargoLock = {
lockFile = ../Cargo.lock;
};
meta.mainProgram = "tasproxy";
}

View file

@ -1,18 +0,0 @@
{
stdenv,
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
src = sourceByRegex ./. ["Cargo.*" "(src)(/.*)?"];
in
rustPlatform.buildRustPackage rec {
pname = "tasproxy";
version = "0.1.0";
inherit src;
cargoLock = {
lockFile = ./Cargo.lock;
};
}