Open Redhawk18 opened 1 year ago
For others experiencing this issue, here's a flake.nix file that appears to fix this issue on my end:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
devShells.default = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [ cmake pkg-config wrapGAppsHook ];
buildInputs = with pkgs; [
xorg.libX11
xorg.libXrandr
xorg.libXcursor
xorg.libXi
libxkbcommon
libGL
fontconfig
wayland
gdk-pixbuf
cairo
pango
atk
gtk3
gsettings-desktop-schemas
];
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath buildInputs;
shellHook = ''
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
'';
};
});
}
https://docs.rs/rfd/latest/rfd/#gtk-backend
Is this not up to date?
@PolyMeilex I definitely don't understand much about the problem, but in doing some digging it looks like the way NixOS operates when it comes to gsettings schemas requires a bit of extra care in the environment variables:
https://discourse.nixos.org/t/custom-gsettings-schema-being-ignored-in-xdg-data-dirs/3449
The flake.nix file I shared was cobbled together after playing around with various cargo builds. When I bumped into @Redhawk18's specific problem then I added the shell hook portion at the bottom.
https://docs.rs/rfd/latest/rfd/#gtk-backend doesn't specify a version. Right now using cargo-deb in my Cargo.toml file I have (some parts elided):
[dependencies]
rfd = { version = "0.14", default-features = false, features = ["xdg-portal", "tokio"] }
[package.metadata.deb]
depends = "$auto, xdg-desktop-portal-kde (>= 5.27.5-2) | xdg-desktop-portal-gtk (>= 1.14.1-1) | xdg-desktop-portal-gnome (>= 43.1-2)"
This is probably wrong, but the best that I know.
I built my iced app on nixos, however when trying to create a rfd window. Some of the gtk3 dependencies are missing because I get this error
a full list would be nice