Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions modules/services/window-managers/xmonad.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ in

config =
let
# GHC sets OS_ARCH to arm in case of armv7l, need to coerce
executableSystemSuffix =
if pkgs.stdenv.hostPlatform.isArmv7 then
"arm-${lib.toLower pkgs.stdenv.hostPlatform.uname.system}"
else
pkgs.stdenv.hostPlatform.system;

xmonadBin = "${
pkgs.runCommandLocal "xmonad-compile"
Expand Down Expand Up @@ -141,15 +147,15 @@ in

# The resulting binary name depends on the arch and os
# https://github.com/xmonad/xmonad/blob/56b0f850bc35200ec23f05c079eca8b0a1f90305/src/XMonad/Core.hs#L565-L572
if [ -f "$XMONAD_DATA_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" ]; then
if [ -f "$XMONAD_DATA_DIR/xmonad-${executableSystemSuffix}" ]; then
# xmonad 0.15.0
mv "$XMONAD_DATA_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" $out/bin/
mv "$XMONAD_DATA_DIR/xmonad-${executableSystemSuffix}" $out/bin/
else
# xmonad 0.17.0 (https://github.com/xmonad/xmonad/commit/9813e218b034009b0b6d09a70650178980e05d54)
mv "$XMONAD_CACHE_DIR/xmonad-${pkgs.stdenv.hostPlatform.system}" $out/bin/
mv "$XMONAD_CACHE_DIR/xmonad-${executableSystemSuffix}" $out/bin/
fi
''
}/bin/xmonad-${pkgs.stdenv.hostPlatform.system}";
}/bin/xmonad-${executableSystemSuffix}";

in
mkIf cfg.enable (mkMerge [
Expand Down