diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..b87e0a5 --- /dev/null +++ b/default.nix @@ -0,0 +1,57 @@ +{pkgs ? import {}}: let + cargoRoot = "src-tauri"; + src = ./.; + + patchSassEmbedded = pkgs.writeShellScriptBin "patch-sass-embedded" '' + NIX_LD="${pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker"}" + for dart_bin in node_modules/sass-embedded-linux-*/dart-sass/src/dart; do + if [ -f "$dart_bin" ]; then + ${pkgs.patchelf}/bin/patchelf --set-interpreter "$NIX_LD" "$dart_bin" + fi + done + ''; +in + pkgs.rustPlatform.buildRustPackage { + pname = "creamlinux-installer"; + version = "1.5.0-unstable-2026-04-23"; + inherit src; + + cargoLock.lockFile = ./src-tauri/Cargo.lock; + + npmDeps = pkgs.fetchNpmDeps { + inherit src; + hash = "sha256-anYTERlnfOGDsGW0joy+h7wECJNDy6q+0a2to6t36pg="; + }; + + nativeBuildInputs = + [ + pkgs.cargo-tauri.hook + pkgs.nodejs + pkgs.npmHooks.npmConfigHook + pkgs.pkg-config + ] + ++ pkgs.lib.optionals pkgs.stdenv.isLinux [ + pkgs.wrapGAppsHook4 + ]; + + buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [ + pkgs.glib-networking + pkgs.openssl + pkgs.webkitgtk_4_1 + ]; + + inherit cargoRoot; + + buildAndTestSubdir = cargoRoot; + + postPatch = '' + substituteInPlace src-tauri/tauri.conf.json \ + --replace-fail '"createUpdaterArtifacts": true' '"createUpdaterArtifacts": false' + ''; + + preBuild = '' + ${patchSassEmbedded}/bin/patch-sass-embedded + ''; + + env.NO_STRIP = true; + } diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 1694bf3..7ab16a7 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -30,7 +30,7 @@ tauri-plugin-shell = "2.0.0-rc" tauri-plugin-dialog = "2.0.0-rc" tauri-plugin-fs = "2.0.0-rc" num_cpus = "1.16.0" -tauri-plugin-process = "2" +tauri-plugin-process = "2.2.1" async-trait = "0.1.89" sha2 = "0.10.9" rand = "0.9.2" @@ -39,4 +39,4 @@ rand = "0.9.2" custom-protocol = ["tauri/custom-protocol"] [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] -tauri-plugin-updater = "2" +tauri-plugin-updater = "2.7.1"