nix-git/modules/spaceFM.nix
2023-12-20 14:38:55 +01:00

26 lines
929 B
Nix

{ config, pkgs, lib, ... }:
{
users.users.yoda = {
packages = with pkgs; [
spaceFM
];
};
# spaceFM won't start on Wayland except setting GDK_BACKEND=x11.
# See https://github.com/NixOS/nixpkgs/issues/275426
nixpkgs.overlays = lib.mkIf (config.services.xserver.displayManager.gdm.wayland) [
(final: prev: {
spaceFM = prev.spaceFM.overrideAttrs (oldAttrs: {
postInstall = (oldAttrs.postInstall or "") + ''
substituteInPlace $out/share/applications/spacefm.desktop \
--replace "Exec=spacefm" "Exec=env GDK_BACKEND=x11 spacefm"
substituteInPlace $out/share/applications/spacefm-find.desktop \
--replace "Exec=spacefm" "Exec=env GDK_BACKEND=x11 spacefm"
substituteInPlace $out/share/applications/spacefm-folder-handler.desktop \
--replace "Exec=spacefm" "Exec=env GDK_BACKEND=x11 spacefm"
'';
});
})
];
}