mpv: make wrapped package available via package
This commit is contained in:
parent
da6077a899
commit
9ff2188c5d
|
@ -39,11 +39,24 @@ let
|
|||
concatStringsSep "\n"
|
||||
(mapAttrsToList (name: value: "${name} ${value}") bindings);
|
||||
|
||||
mpvPackage = if cfg.scripts == [ ] then
|
||||
pkgs.mpv
|
||||
else
|
||||
pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; };
|
||||
|
||||
in {
|
||||
options = {
|
||||
programs.mpv = {
|
||||
enable = mkEnableOption "mpv";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Resulting mpv package.
|
||||
'';
|
||||
};
|
||||
|
||||
scripts = mkOption {
|
||||
type = with types; listOf (either package str);
|
||||
default = [ ];
|
||||
|
@ -121,12 +134,8 @@ in {
|
|||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
home.packages = [
|
||||
(if cfg.scripts == [ ] then
|
||||
pkgs.mpv
|
||||
else
|
||||
pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; })
|
||||
];
|
||||
home.packages = [ mpvPackage ];
|
||||
programs.mpv.package = mpvPackage;
|
||||
}
|
||||
(mkIf (cfg.config != { } || cfg.profiles != { }) {
|
||||
xdg.configFile."mpv/mpv.conf".text = ''
|
||||
|
|
Loading…
Reference in a new issue