From 3c376038a8c12a2d9c4fd8a7c41035a17d1f7c5a Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 20 Dec 2023 14:38:55 +0100 Subject: [PATCH] add spacefm --- hosts/yodaTux/configuration.nix | 1 + modules/spaceFM.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/spaceFM.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index f2fc916..eea5d7a 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -25,6 +25,7 @@ ../../modules/wallpaper.nix ../../modules/programs.nix + ../../modules/spaceFM.nix ../../modules/nextcloud-integration.nix ../../modules/syncthing.nix ../../modules/signal-desktop.nix diff --git a/modules/spaceFM.nix b/modules/spaceFM.nix new file mode 100644 index 0000000..96f5c0b --- /dev/null +++ b/modules/spaceFM.nix @@ -0,0 +1,25 @@ +{ 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" + ''; + }); + }) + ]; +}