diff --git a/hosts/pinwheel/modules/picard/default.nix b/hosts/pinwheel/modules/picard/default.nix index eaec436..29663a2 100644 --- a/hosts/pinwheel/modules/picard/default.nix +++ b/hosts/pinwheel/modules/picard/default.nix @@ -8,6 +8,15 @@ let 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, ... }: { @@ -17,8 +26,8 @@ in ]; home.activation.picardReplayGainPlugin = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - if ! ${pkgs.picard}/bin/picard-cli plugins info replaygain2 > /dev/null 2>&1; then - run ${pkgs.picard}/bin/picard-cli plugins install replaygain2 \ + 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 '';