feat: add disneyplus wrapper

This commit is contained in:
Patrick 2024-11-14 12:36:56 +01:00
parent f89c37cb79
commit c6628ba634
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
3 changed files with 74 additions and 2 deletions

View file

@ -1,5 +1,5 @@
diff --git a/nixos/modules/services/security/kanidm.nix b/nixos/modules/services/security/kanidm.nix
index a368b6eee2a6e..96f6e23740c80 100644
index a368b6eee2a6e..114400de434a3 100644
--- a/nixos/modules/services/security/kanidm.nix
+++ b/nixos/modules/services/security/kanidm.nix
@@ -502,13 +502,13 @@ in
@ -7,7 +7,7 @@ index a368b6eee2a6e..96f6e23740c80 100644
originUrl = mkOption {
- description = "The origin URL of the service. OAuth2 redirects will only be allowed to sites under this origin. Must end with a slash.";
+ description = "The origin URL of the service. OAuth2 redirects will only need to either exactly match or match this origin depending on wether strict-redirect is enabled.";
+ description = "The redirect URL of the service. By default this needs to exactly match the OAuth2 redirect target. When disabling strict-redirect-uri kanidm will only match by origin.";
type =
let
- originStrType = types.strMatching ".*://.*/$";

View file

@ -8,6 +8,7 @@ _inputs: [
signal-to-blog = prev.callPackage ./signal-to-blog.nix { };
minion = prev.callPackage ./minion.nix { };
mongodb-bin = prev.callPackage ./mongodb-bin.nix { };
disneyplus = prev.callPackage ./disney.nix { };
awakened-poe-trade = prev.callPackage ./awakened-poe-trade.nix { };
neovim-clean = prev.neovim-unwrapped.overrideAttrs (
_neovimFinal: neovimPrev: {

71
pkgs/disney.nix Normal file
View file

@ -0,0 +1,71 @@
{
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 = {
description = "Open Netflix in Google Chrome app mode";
longDescription = ''
Netflix is a video streaming service providing films, TV series and exclusive content. See https://www.netflix.com.
This package installs an application launcher item that opens Netflix in a dedicated Google Chrome window. If your preferred browser doesn't support Netflix's DRM, this package provides a quick and easy way to launch Netflix on a supported browser, without polluting your application list with a redundant, single-purpose browser.
'';
homepage = google-chrome.meta.homepage or null;
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.roberth ];
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 {
name = "netflix-icon-2016.png";
url = "https://assets.nflxext.com/us/ffe/siteui/common/icons/nficon2016.png";
sha256 = "sha256-c0H3uLCuPA2krqVZ78MfC1PZ253SkWZP3PfWGP2V7Yo=";
meta.license = lib.licenses.unfree;
};
desktopName = "Netflix via Google Chrome";
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
];
}