diff --git a/common/pkgs/polybar-spotify.nix b/common/pkgs/polybar-spotify.nix new file mode 100644 index 0000000..2afeb42 --- /dev/null +++ b/common/pkgs/polybar-spotify.nix @@ -0,0 +1,19 @@ +{ pkgs }: +pkgs.stdenv.mkDerivation rec { + pname = "polybar-spotify"; + version = "5edc2e598cf0ec5c54860c28db870af998271666"; + + src = pkgs.fetchFromGitHub { + owner = "Jvanrhijn"; + repo = pname; + rev = version; + sha256 = "sha256-JPoigtxBYnFqi+8erhTcJlGN53VtS6z9mqNajQM0Xsk="; + }; + + propagatedBuildInputs = [ + (pkgs.python39.withPackages (pyPkgs: [ pyPkgs.dbus-python ])) + pkgs.playerctl + ]; + + installPhase = "install -Dm755 ./spotify_status.py $out/bin/polybar-spotify"; +} diff --git a/hosts/ritual/configuration.nix b/hosts/ritual/configuration.nix index 74e217a..f7e4fe4 100644 --- a/hosts/ritual/configuration.nix +++ b/hosts/ritual/configuration.nix @@ -10,6 +10,8 @@ (final: prev: { pads = final.callPackage ../../common/pkgs/pads.nix { }; bspm = final.callPackage ../../common/pkgs/bspm.nix { }; + polybar-spotify = + final.callPackage ../../common/pkgs/polybar-spotify.nix { }; }) ]; @@ -51,6 +53,9 @@ settings = { General = { Disable = "Headset"; }; }; }; + # Don't suspend when closed and plugged into power + services.logind.lidSwitchExternalPower = "ignore"; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave