From b2a14d546866d38b25aa4200e1a833a26ed7fc58 Mon Sep 17 00:00:00 2001 From: muon Date: Sat, 28 Mar 2026 16:16:08 +0000 Subject: [PATCH] Add dcts --- _sources/generated.json | 21 +++++ _sources/generated.nix | 11 +++ modules/home/desktop/social.nix | 2 + nvfetcher.toml | 4 + pkgs/dcts-client-shipping/package.nix | 120 ++++++++++++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 pkgs/dcts-client-shipping/package.nix diff --git a/_sources/generated.json b/_sources/generated.json index 17cfd37..e8ba227 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -1,4 +1,25 @@ { + "dcts-client-shipping": { + "cargoLock": null, + "date": null, + "extract": null, + "name": "dcts-client-shipping", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "hackthedev", + "repo": "dcts-client-shipping", + "rev": "v2.5", + "sha256": "sha256-fmU/rUIyHV/+GSgDuot3mDaZrYmxfhF3RXSAwE6HqPU=", + "sparseCheckout": [], + "type": "github" + }, + "version": "v2.5" + }, "mender-cli": { "cargoLock": null, "date": null, diff --git a/_sources/generated.nix b/_sources/generated.nix index 68f3e7b..0c44cb5 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -6,6 +6,17 @@ dockerTools, }: { + dcts-client-shipping = { + pname = "dcts-client-shipping"; + version = "v2.5"; + src = fetchFromGitHub { + owner = "hackthedev"; + repo = "dcts-client-shipping"; + rev = "v2.5"; + fetchSubmodules = false; + sha256 = "sha256-fmU/rUIyHV/+GSgDuot3mDaZrYmxfhF3RXSAwE6HqPU="; + }; + }; mender-cli = { pname = "mender-cli"; version = "2.0.0"; diff --git a/modules/home/desktop/social.nix b/modules/home/desktop/social.nix index e9e1c54..90585e1 100644 --- a/modules/home/desktop/social.nix +++ b/modules/home/desktop/social.nix @@ -13,6 +13,7 @@ # inherit (pkgs) system; # config = pkgs.config; # }).freetube; + dcts-client-shipping = pkgs.callPackage ../../../pkgs/dcts-client-shipping/package.nix { inherit sources; }; in { options.mods.social.enable = lib.mkEnableOption "enables social media clients"; @@ -26,6 +27,7 @@ in { # vesktop-nogain # (callPackage ./packages/librediscord.nix {}) jami + dcts-client-shipping # Video # freetube-custom diff --git a/nvfetcher.toml b/nvfetcher.toml index 6aa7914..a10a48d 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -161,3 +161,7 @@ fetch.tarball = "https://thunderstore.io/package/download/BentoG/MissingPieces/$ src.github = "mendersoftware/mender-cli" fetch.github = "mendersoftware/mender-cli" +["dcts-client-shipping"] +src.github = "hackthedev/dcts-client-shipping" +fetch.github = "hackthedev/dcts-client-shipping" + diff --git a/pkgs/dcts-client-shipping/package.nix b/pkgs/dcts-client-shipping/package.nix new file mode 100644 index 0000000..6f7c640 --- /dev/null +++ b/pkgs/dcts-client-shipping/package.nix @@ -0,0 +1,120 @@ +{ + lib, + stdenv, + stdenvNoCC, + bun, + electron, + fetchFromGitHub, + makeWrapper, + makeBinaryWrapper, + makeDesktopItem, + copyDesktopItems, + sources, + writableTmpDirAsHomeHook, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "dcts-client-shipping"; + version = sources.dcts-client-shipping.version; + src = sources.dcts-client-shipping.src; + + node_modules = stdenvNoCC.mkDerivation { + pname = "${finalAttrs.pname}-node_modules"; + inherit (finalAttrs) version src; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + "GIT_PROXY_COMMAND" + "SOCKS_SERVER" + ]; + + nativeBuildInputs = [ + bun + writableTmpDirAsHomeHook + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + cd electron + bun install \ + --cpu="*" \ + --frozen-lockfile \ + --ignore-scripts \ + --no-progress \ + --os="*" + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/electron + cp -R node_modules $out/electron/ + + runHook postInstall + ''; + + # NOTE: Required else we get errors that our fixed-output derivation references store paths + dontFixup = true; + + outputHash = "sha256-TwfxQeK1KkKY1n/735sTxcAQfR5hUrONJcWeIaM47SE="; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }; + + nativeBuildInputs = [ + bun + makeBinaryWrapper + copyDesktopItems + writableTmpDirAsHomeHook + ]; + + desktopItems = [ + (makeDesktopItem { + name = "dcts"; + desktopName = "DCTS"; + comment = "DCTS Desktop Client - Secure messaging"; + exec = "dcts"; + icon = "dcts"; + categories = [ "Network" "InstantMessaging" ]; + }) + ]; + + buildPhase = '' + runHook preBuild + + # Copy node_modules from the separate derivation + cp -R ${finalAttrs.node_modules}/electron/node_modules electron/ + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib/dcts + cp -R electron/* $out/lib/dcts/ + + # Create wrapper script + makeWrapper ${electron}/bin/electron $out/bin/dcts \ + --add-flags $out/lib/dcts \ + --set ELECTRON_OVERRIDE_DIST_PATH ${electron}/bin/ + + # Install icon + install -Dm644 electron/icon.png $out/share/icons/hicolor/256x256/apps/dcts.png + + runHook postInstall + ''; + + meta = { + description = "DCTS Desktop Client - Electron app for secure messaging"; + homepage = "https://github.com/hackthedev/dcts-client-shipping"; + license = lib.licenses.isc; + maintainers = [ ]; + platforms = lib.platforms.linux; + mainProgram = "dcts"; + }; +})