···1616 sourceRoot = "${src-service.name}";
17171818 patches = [
1919- # FIXME: remove until upstream fix these
2020- # https://github.com/clash-verge-rev/clash-verge-rev/issues/3428
1919+ # I want to keep these patches because it's not harmful.
21202221 # Patch: Restrict bin_path in spawn_process to be under the clash-verge-service directory.
2322 # This prevents arbitrary code execution by ensuring only trusted binaries from the Nix store are allowed to run.
···2625 # Patch: Add validation to prevent overwriting existing files.
2726 # This mitigates arbitrary file overwrite risks by ensuring a file does not already exist before writing.
2827 ./0002-core-prevent-overwriting-existing-file-by-validating.patch
2828+2929+ # Patch: move IPC directory from /tmp to /run/clash-verge-rev/service.lock
3030+ # This allows we enable ProtectSystem="strict" and PrivateTmp
3131+ ./0003-IPC-move-path-to-run-clash-verge-rev-service.sock.patch
2932 ];
30333134 nativeBuildInputs = [
+4
pkgs/by-name/cl/clash-verge-rev/unwrapped.nix
···4949 # If you need a newer version, you can override the mihomo input of the wrapped package
5050 sed -i -e '/Mihomo Alpha/d' ./src/components/setting/mods/clash-core-viewer.tsx
51515252+ # See service.nix for reasons
5353+ substituteInPlace src-tauri/src/core/service_ipc.rs \
5454+ --replace-fail "/tmp/clash-verge-service.sock" "/run/clash-verge-rev/service.sock"
5555+5256 substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
5357 --replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
5458
···11+{
22+ lib,
33+ fetchzip,
44+ libblake3,
55+ libmd,
66+ xxHash,
77+ zlib,
88+ zstd,
99+ buildTopkgPackage,
1010+}:
1111+1212+buildTopkgPackage rec {
1313+ pname = "bytesrw";
1414+ version = "0.1.0";
1515+1616+ minimalOCamlVersion = "4.14.0";
1717+1818+ src = fetchzip {
1919+ url = "https://erratique.ch/software/bytesrw/releases/bytesrw-${version}.tbz";
2020+ hash = "sha256-leH3uo5Q8ba22A/Mbl9pio0tW/IxCTGp77Cra7l4D80=";
2121+ };
2222+2323+ # docs say these are optional, but buildTopkgPackage doesn’t handle missing
2424+ # dependencies
2525+2626+ buildInputs = [
2727+ libblake3
2828+ libmd
2929+ xxHash
3030+ zlib
3131+ zstd
3232+ ];
3333+3434+ meta = {
3535+ description = "composable, memory efficient, byte stream readers and writers compatible with effect-based concurrency";
3636+ longDescription = ''
3737+ Bytesrw extends the OCaml Bytes module with composable, memory efficient,
3838+ byte stream readers and writers compatible with effect-based concurrency.
3939+4040+ Except for byte slice life-times, these abstractions intentionnaly
4141+ separate away ressource management and the specifics of reading and
4242+ writing bytes.
4343+ '';
4444+ homepage = "https://erratique.ch/software/bytesrw";
4545+ license = lib.licenses.isc;
4646+ maintainers = with lib.maintainers; [ toastal ];
4747+ };
4848+}
+54
pkgs/development/ocaml-modules/jsont/default.nix
···11+{
22+ lib,
33+ fetchzip,
44+ buildTopkgPackage,
55+ brr,
66+ bytesrw,
77+ cmdliner,
88+}:
99+1010+buildTopkgPackage rec {
1111+ pname = "jsont";
1212+ version = "0.1.1";
1313+1414+ minimalOCamlVersion = "4.14.0";
1515+1616+ src = fetchzip {
1717+ url = "https://erratique.ch/software/jsont/releases/jsont-${version}.tbz";
1818+ hash = "sha256-bLbTfRVz/Jzuy2LnQeTEHQGojfA34M+Xj7LODpBAVK4=";
1919+ };
2020+2121+ # docs say these dependendencies are optional, but buildTopkgPackage doesn’t
2222+ # handle missing dependencies
2323+2424+ buildInputs = [
2525+ cmdliner
2626+ ];
2727+2828+ propagatedBuildInputs = [
2929+ brr
3030+ bytesrw
3131+ ];
3232+3333+ meta = {
3434+ description = "declarative JSON data manipulation";
3535+ longDescription = ''
3636+ Jsont is an OCaml library for declarative JSON data manipulation. it
3737+ provides:
3838+3939+ • Combinators for describing JSON data using the OCaml values of your
4040+ choice. The descriptions can be used by generic functions to decode,
4141+ encode, query and update JSON data without having to construct a
4242+ generic JSON representation
4343+ • A JSON codec with optional text location tracking and best-effort
4444+ layout preservation. The codec is compatible with effect-based
4545+ concurrency.
4646+4747+ The descriptions are independent from the codec and can be used by
4848+ third-party processors or codecs.
4949+ '';
5050+ homepage = "https://erratique.ch/software/jsont";
5151+ license = lib.licenses.isc;
5252+ maintainers = with lib.maintainers; [ toastal ];
5353+ };
5454+}