From 3217f26b19b8323d3aa8c50276777aa3cc0e9d59 Mon Sep 17 00:00:00 2001 From: xenofem Date: Sun, 23 Apr 2023 01:54:59 -0400 Subject: [PATCH] adjust mpv flags to work with 22.11 or 23.05 --- flake.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 6b34069..895acbf 100644 --- a/flake.nix +++ b/flake.nix @@ -47,11 +47,21 @@ overlays.default = final: prev: let newScripts = packages.packages.${prev.system}; in rec { - mpv-unwrapped = prev.mpv-unwrapped.overrideAttrs (oldAttrs: { - wafConfigureFlags = oldAttrs.wafConfigureFlags ++ [ - "--confloaddir=/etc/mpv" - ]; - }); + mpv-unwrapped = prev.mpv-unwrapped.overrideAttrs (oldAttrs: + if oldAttrs ? wafConfigureFlags + then { + wafConfigureFlags = oldAttrs.wafConfigureFlags ++ [ + "--confloaddir=/etc/mpv" + ]; + } + else if oldAttrs ? mesonFlags + then { + mesonFlags = oldAttrs.mesonFlags ++ [ + "-Dsysconfdir=/etc" + ]; + } + else oldAttrs + ); mpv = prev.wrapMpv mpv-unwrapped { scripts = builtins.attrValues newScripts; };