nix: Init package

This commit is contained in:
Agahnim
2026-04-23 16:16:36 +02:00
parent 92f4d82e6c
commit 33492a6a55
2 changed files with 59 additions and 2 deletions

57
default.nix Normal file
View File

@@ -0,0 +1,57 @@
{pkgs ? import <nixpkgs> {}}: 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;
}

View File

@@ -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"