DioxusLabs / DioxusLabs/dioxus
Can't bundle apps from nix Flake
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
I am part here to ask for help because some issues I run into might just be issues with my flake config. I can't figure out how to bundle my app for different platforms from my flake. Ideally I'd want at least an AppImage for Linux, MSI for Windows, and I guess dmg for Mac. So far the only bundle that runs is deb. Building a linux and windows release binary works fine and I can run both but ideally I want it to be installable, portable and include the icon, so I need the bundles to work. I understand if it's impossible and it must be done from the target system, etc, but given that the app binary already works I would assume the bundling should be the simpler part.
Does anyone have a working flake.nix that defines packages to bundle for linux (any), windows and mac? This is what I have:
```nix
# Define cross system
let
win64Pkgs = import nixpkgs {
inherit system;
crossSystem = {
config = "x86_64-w64-mingw32";
};
};
in
<...>
# This builds an exe, not bundled
packages.windows = win64Pkgs.rustPlatform.buildRustPackage {
inherit
pname
version
src
cargoLock
doCheck
RUST_BACKTRACE
;
};
```
Tried adding this:
```nix
nativeBuildInputs = with pkgs; [
dioxus-cli
cmake
];
buildPhase = ''
dx bundle --release --target x86_64-pc-windows-gnu --platform desktop --package-types "nsis"
'';
```
This fails because it tried to download something from GitHub. If I change nsis to `msi` I get this:
```
> 133.540s INFO Running desktop bundler...
> 133.545s ERROR Failed to bundle project: BundlerError(
> "No bundles were built",
> )
> 133.570s ERROR err=BundleFailed(BundlerError(No bundles were built
>
> Stack backtrace:
> 0: anyhow::error::::msg
> 1: tauri_bundler::bundle::bundle_project
> 2: dx::cli::bundle::Bundle::bundle_desktop
> 3: dx::main::{{closure}}
> 4: tokio::runtime::park::CachedParkThread::block_on
> 5: dx::main
```
I also have a definition for deb bundles which works on my computer but it's not portable.
I have the same package config for appimage bundle but it fails with this error:
```
> 210.111s INFO Running desktop bundler...
> 210.153s ERROR Failed to bundle project: IoError(
> Os {
> code: 13,
> kind: PermissionDenied,
> message: "Permission denied",
> },
> )
> 210.156s ERROR err=BundleFailed(IoError(Os { code: 13, kind: PermissionDenied, message: "Permission denied" }))
```
How can I debug this further? Is it even possible?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.