{ pkgs, ... }: let picard = pkgs.symlinkJoin { name = "picard"; paths = [ pkgs.picard ]; nativeBuildInputs = [ pkgs.makeWrapper ]; postBuild = '' wrapProgram $out/bin/picard --set QT_SCREEN_SCALE_FACTORS 1.5 ''; }; plugins = pkgs.linkFarm "picard-plugins" { replaygain2 = pkgs.fetchFromGitHub { owner = "metabrainz"; repo = "picard-plugin-replaygain2"; tag = "v2.3.1"; hash = "sha256-NBn/LgjDRVCHmbI+bU4j29UhrL33ctV9jXj6CfFRBWA="; }; }; in { home-manager.users.alex = { lib, ... }: { home.packages = [ picard pkgs.rsgain ]; home.activation.picardReplayGainPlugin = lib.hm.dag.entryAfter [ "writeBoundary" ] '' if ! ${pkgs.picard}/bin/picard-cli plugins info replaygain2 2>/dev/null | grep -qF "${plugins}/replaygain2"; then run ${pkgs.picard}/bin/picard-cli --yes plugins install --no-git --reinstall "${plugins}/replaygain2" \ || warnEcho "Failed to install Picard plugin replaygain2" fi ''; }; }