Created
October 19, 2019 12:38
-
-
Save roosemberth/ad002c84bbfa58a8c2df5de8b6572b19 to your computer and use it in GitHub Desktop.
Reproductible example showing crash in Taffybar when using mpris2New without librsvg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, ... }: | |
let | |
home-manager = builtins.fetchGit { | |
url = "https://github.com/rycee/home-manager.git"; | |
rev = "ba0375bf06e0e0c3b2377edf913b7fddfd5a0b40"; | |
ref = "release-19.03"; | |
}; | |
taffybar-config = '' | |
{-# LANGUAGE OverloadedStrings #-} | |
import System.Taffybar | |
import System.Taffybar.SimpleConfig | |
import System.Taffybar.Widget | |
clock = textClockNew defaultClockConfig | |
workspaces = workspacesNew defaultWorkspacesConfig | |
config = defaultSimpleTaffyConfig | |
{ startWidgets = [ workspaces ] | |
, centerWidgets = [ mpris2New ] | |
, endWidgets = [ clock ] | |
} | |
main = do | |
startTaffybar $ simpleTaffybar config | |
''; | |
test-mpdconf = '' | |
music_directory "~/music" | |
audio_output { | |
name "none" | |
type "null" | |
} | |
''; | |
# Music from https://filmmusic.io "The Descent" by Kevin MacLeod (https://incompetech.com) License: CC BY (http://creativecommons.org/licenses/by/4.0/) | |
sample-track = pkgs.fetchurl { | |
name = "the-descent.mp3"; | |
url = "https://incompetech.filmmusic.io/song/4490-the-descent/?type=1536437031&cHash=5ab6b7b086f8cf167b7d14d6569ad7e4"; | |
sha256 = "1032nw8x5d37f9vzajk8jnjqkhrxgk9j6r43kdc11pc3r5ykkics"; | |
}; | |
in { | |
imports = [ (home-manager + "/nixos") ]; | |
boot.loader.grub.device = "nodev"; | |
fileSystems."/".device = "/dev/sda"; | |
i18n.consoleFont = "sun12x22"; | |
networking.hostName = "test-taffybar"; | |
security.sudo.enable = true; | |
security.sudo.wheelNeedsPassword = false; | |
services.xserver = { | |
enable = true; | |
displayManager.sddm.enable = true; | |
displayManager.sddm.autoLogin.enable = true; | |
displayManager.sddm.autoLogin.user = "test"; | |
windowManager.xmonad.enable = true; | |
windowManager.default = "xmonad"; | |
windowManager.xmonad.extraPackages = hp: with hp; [xmonad-contrib]; | |
desktopManager.default = "none"; | |
displayManager.sessionCommands = '' | |
${pkgs.taffybar}/bin/taffybar & | |
${pkgs.mpd}/bin/mpd & | |
sleep 6; # wait for the mpd server to come up | |
${pkgs.mpdris2}/bin/mpDris2 & # mpd -> mpdris2 daemon | |
${pkgs.mpc_cli}/bin/mpc update | |
${pkgs.mpc_cli}/bin/mpc add the-descent.mp3 | |
echo Wait for the system to settle before crashing Taffybar | |
${pkgs.mpc_cli}/bin/mpc play | |
''; | |
}; | |
services.journald.console = "/dev/ttyS0"; | |
services.mingetty.autologinUser = "test"; | |
system.stateVersion = "19.09"; | |
systemd.coredump.enable = true; | |
security.pam.loginLimits = [{ | |
domain = "*"; item = "core"; type = "-"; value = "-1"; | |
}]; | |
users.mutableUsers = false; | |
users.extraUsers.test = { | |
password = "test"; | |
isNormalUser = true; | |
extraGroups = ["wheel"]; | |
}; | |
home-manager.users."test".home.file.".local/taffybar/taffybar.hs".text = taffybar-config; | |
home-manager.users."test".home.file.".mpdconf".text = test-mpdconf; | |
home-manager.users."test".home.file."music/the-descent.mp3".source = sample-track; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment