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