Compare commits

..

107
flake.nix
View file

@ -6,35 +6,6 @@
rust-overlay.url = "github:oxalica/rust-overlay";
};
<<<<<<< HEAD
outputs =
{
self,
nixpkgs,
rust-overlay,
...
}:
let
systems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
version = "0.0.10";
x86_64DebHash = "sha256-VVKkZ9yQ7BoLnYnCf5OSHcrakoBNfUx/uWxBmm3gBZE=";
forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}";
in
{
packages = forAllSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
};
debArtifact = "Tensamin-${version}-linux-amd64.deb";
=======
outputs = {
self,
nixpkgs,
@ -57,7 +28,6 @@
};
};
debArtifact = "Tensamin-${version}-linux-amd64.deb";
>>>>>>> refs/remotes/origin/dev
electronRuntimeLibs = with pkgs; [
alsa-lib
@ -99,8 +69,7 @@
libXtst
libxcb
];
packageDeb =
src:
packageDeb = src:
pkgs.stdenv.mkDerivation {
pname = "tensamin";
inherit version src;
@ -131,47 +100,40 @@
mkdir -p "$out/bin"
makeWrapper "$out/opt/Tensamin/tensamin" "$out/bin/tensamin"
substituteInPlace "$out/share/applications/Tensamin.desktop" \
substituteInPlace "$out/share/applications/tensamin.desktop" \
--replace-fail "Exec=/opt/Tensamin/tensamin" "Exec=tensamin"
runHook postInstall
'';
};
defaultPackage = packageDeb (
pkgs.fetchurl {
defaultPackage = packageDeb (pkgs.fetchurl {
url = "${forgejoBaseUrl}/${debArtifact}";
hash = x86_64DebHash;
}
);
});
localDebPath = builtins.getEnv "TENSAMIN_DEB";
localPathPackage =
if localDebPath == "" then
if localDebPath == ""
then
pkgs.writeShellScriptBin "tensamin" ''
echo "Set TENSAMIN_DEB to a local .deb path and run with --impure." >&2
exit 1
''
else
packageDeb (
builtins.path {
packageDeb (builtins.path {
path = localDebPath;
name = debArtifact;
}
);
in
{
});
in {
default = defaultPackage;
tensamin = defaultPackage;
electron = defaultPackage;
localPathForDev = localPathPackage;
}
);
});
devShells = forAllSystems (
system:
let
devShells = forAllSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
overlays = [(import rust-overlay)];
config = {
allowUnfree = true;
android_sdk.accept_license = true;
@ -225,22 +187,16 @@
cmdLineToolsVersion = "8.0";
toolsVersion = "26.1.1";
platformToolsVersion = "35.0.2";
buildToolsVersions = [ buildToolsVersion ];
platformVersions = [
"35"
"36"
];
buildToolsVersions = [buildToolsVersion];
platformVersions = ["35" "36"];
includeSources = false;
includeSystemImages = false;
includeNDK = true;
ndkVersions = [ ndkVersion ];
ndkVersions = [ndkVersion];
useGoogleAPIs = false;
};
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
extensions = ["rust-src" "rust-analyzer"];
targets = [
"aarch64-linux-android"
"armv7-linux-androideabi"
@ -250,37 +206,23 @@
];
};
commonDeps = [
rustToolchain
pkgs.wasm-pack
pkgs.lld
];
commonDeps = [rustToolchain pkgs.wasm-pack pkgs.lld];
appImageToolsArchive = pkgs.fetchurl {
url = "https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz";
hash = "sha256-hAIaeO4hSub9M6LWKpK6JVQt0QvIa/EXqbLQu6ROdmU=";
};
appImageTools =
pkgs.runCommand "electron-builder-appimage-tools-nix"
{
nativeBuildInputs = [
pkgs.gnutar
pkgs.gzip
];
}
''
appImageTools = pkgs.runCommand "electron-builder-appimage-tools-nix" {nativeBuildInputs = [pkgs.gnutar pkgs.gzip];} ''
mkdir -p "$out"
tar -xzf ${appImageToolsArchive} --strip-components=1 -C "$out"
rm -f "$out/mksquashfs" "$out/desktop-file-validate"
ln -s ${pkgs.squashfsTools}/bin/mksquashfs "$out/mksquashfs"
ln -s ${pkgs.desktop-file-utils}/bin/desktop-file-validate "$out/desktop-file-validate"
'';
in
rec {
in rec {
default = electron;
electron = pkgs.mkShell {
packages =
with pkgs;
packages = with pkgs;
[
nodejs_22
corepack_22
@ -303,8 +245,7 @@
xz
p7zip
]
++ electronRuntimeLibs
++ commonDeps;
++ electronRuntimeLibs ++ commonDeps;
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath electronRuntimeLibs}:$LD_LIBRARY_PATH"
@ -325,8 +266,7 @@
};
tauri = pkgs.mkShell {
buildInputs =
with pkgs;
buildInputs = with pkgs;
[
jdk17
gradle
@ -400,7 +340,6 @@
fi
'';
};
}
);
});
};
}