nix-config/pkgs/disney.nix

72 lines
2.2 KiB
Nix
Raw Normal View History

2024-11-14 12:36:56 +01:00
{
fetchurl,
google-chrome,
lib,
makeDesktopItem,
runtimeShell,
symlinkJoin,
writeScriptBin,
# command line arguments which are always set e.g "--disable-gpu"
commandLineArgs ? [ ],
}:
let
name = "disneyplus-via-google-chrome";
meta = {
2024-11-18 13:44:59 +01:00
description = "Open DisneyPlus in Google Chrome app mode";
2024-11-14 12:36:56 +01:00
longDescription = ''
2024-11-18 13:44:59 +01:00
DisneyPlus is a video streaming service providing films, TV series and exclusive content. See https://www.DisneyPlus.com.
2024-11-14 12:36:56 +01:00
2024-11-18 13:44:59 +01:00
This package installs an application launcher item that opens DisneyPlus in a dedicated Google Chrome window. If your preferred browser doesn't support DisneyPlus's DRM, this package provides a quick and easy way to launch DisneyPlus on a supported browser, without polluting your application list with a redundant, single-purpose browser.
2024-11-14 12:36:56 +01:00
'';
homepage = google-chrome.meta.homepage or null;
license = lib.licenses.unfree;
2024-11-18 13:44:59 +01:00
maintainers = [ lib.maintainers.patrickdag ];
2024-11-14 12:36:56 +01:00
platforms = google-chrome.meta.platforms or lib.platforms.all;
};
desktopItem = makeDesktopItem {
inherit name;
# Executing by name as opposed to store path is conventional and prevents
# copies of the desktop file from bitrotting too much.
# (e.g. a copy in ~/.config/autostart, you lazy lazy bastard ;) )
exec = name;
icon = fetchurl {
2024-11-18 13:44:59 +01:00
name = "disneyplus-logo-2024.jpg";
url = "https://lumiere-a.akamaihd.net/v1/images/disney_logo_march_2024_050fef2e.png?region=0%2C0%2C1920%2C1080";
sha256 = "sha256-t71veeGtr3LF3Rzf47YFY7j9XEYmxW/Ob6eluJx1skE=";
2024-11-14 12:36:56 +01:00
meta.license = lib.licenses.unfree;
};
2024-11-18 13:44:59 +01:00
desktopName = "DisneyPlus via Google Chrome";
2024-11-14 12:36:56 +01:00
genericName = "A video streaming service providing films and exclusive TV series";
categories = [
"TV"
"AudioVideo"
"Network"
];
startupNotify = true;
};
script = writeScriptBin name ''
#!${runtimeShell}
exec ${google-chrome}/bin/${google-chrome.meta.mainProgram} ${lib.escapeShellArgs commandLineArgs} \
--app=https://www.disneyplus.com \
--no-first-run \
--no-default-browser-check \
--no-crash-upload \
--user-data-dir=$HOME/.config/disneyplus \
"$@"
'';
in
symlinkJoin {
inherit name meta;
paths = [
script
desktopItem
];
}