diff --git a/pkgs/by-name/si/silverfort-client/dont-delete-envfile.patch b/pkgs/by-name/si/silverfort-client/dont-delete-envfile.patch deleted file mode 100644 index 038ade321398..000000000000 --- a/pkgs/by-name/si/silverfort-client/dont-delete-envfile.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/build/electron/main.js b/build/electron/main.js -index ca36c4b..dbea8c6 100644 ---- a/build/electron/main.js -+++ b/build/electron/main.js -@@ -324,12 +324,6 @@ const readEnvVars = async () => { - disableStartup = envVariables.SF_DISABLE_STARTUP; - } - -- try { -- await fsPromises.unlink(configFileName, { force: true }); -- } catch (err) { -- log.error(`failed to delete env file (${configFileName})`, err.toString()); -- } -- - log.info(`Env vars loaded from file. (${configFileName}) `); - - return { url, id }; diff --git a/pkgs/by-name/si/silverfort-client/package.nix b/pkgs/by-name/si/silverfort-client/package.nix index 4ce23a1efb4f..345a1b162176 100644 --- a/pkgs/by-name/si/silverfort-client/package.nix +++ b/pkgs/by-name/si/silverfort-client/package.nix @@ -11,11 +11,11 @@ }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "silverfort-client"; - version = "3.7.5"; + version = "3.7.6"; src = requireFile rec { name = "${finalAttrs.pname}_${finalAttrs.version}_amd64.deb"; - hash = "sha256-eOkSVoucMiGH4sTnC8/3sWMyT9DpnGEYXX+1y2ULDBg="; + hash = "sha256-r/za9JNQoVVowYp3DQ7nHfS+W74v5SZWOmRmIiRvOKw="; message = '' Due to the commercial license of Silverfort, Nix is unable to download Silverfort automatically. Please download ${name} manually and add it @@ -61,11 +61,20 @@ stdenvNoCC.mkDerivation (finalAttrs: { }) ]; + postPatch = '' + asar extract "opt/Silverfort Client/resources/app.asar" $TMP/work + + # By default, Silverfort will delete the envfile after it has been read one time. + # This file is located at "~/.config/Silverfort Client/config.env" and can be configured + # to store environment variables in JSON format. + # For example: `{"SF_MESSAGING_URL":"https://example-sdms-server.net"}` + substituteInPlace $TMP/work/build/electron/main.js --replace-fail \ + 'try{await fsPromises.unlink(t,{force:!0})}catch(e){log.error(`failed to delete env file (''${t})`,e.toString())}' "" + ''; + installPhase = '' runHook preInstall - asar extract "opt/Silverfort Client/resources/app.asar" $TMP/work - # Remove unneeded files rm $TMP/work/build/{"public assests.zip",robots.txt} @@ -74,16 +83,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { install -Dm444 $TMP/work/build/favicon.ico $out/share/icons/hicolor/256x256/apps/silverfort-client.png install -Dm444 $TMP/work/build/logo512.png $out/share/icons/hicolor/512x512/apps/silverfort-client.png - # By default, Silverfort will delete the envfile after it has been read one time. - # This file is located at "~/.config/Silverfort Client/config.env" and can be configured - # to store environment variables in JSON format. - # For example: `{"SF_MESSAGING_URL":"https://example-sdms-server.net"}` - patch -d $TMP/work -p1 < ${./dont-delete-envfile.patch} - asar pack $TMP/work $out/share/silverfort-client/resources/app.asar - rm -rf $TMP/work - runHook postInstall '';