summary refs log tree commit diff
path: root/pkgs/applications/video
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-01-22 14:17:25 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-12-09 16:56:45 +0100
commit9aa8863a8ffcad0626a9e160da16a95f82e08f5c (patch)
tree09554bdc917c6682121f50137a2356ac75cb5d2f /pkgs/applications/video
parent906f39d0519b97486fa5cc7a2d27a85bbb31499e (diff)
downloadnixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar.gz
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar.bz2
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar.lz
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar.xz
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.tar.zst
nixpkgs-9aa8863a8ffcad0626a9e160da16a95f82e08f5c.zip
netflix: init
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/netflix/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/applications/video/netflix/default.nix b/pkgs/applications/video/netflix/default.nix
new file mode 100644
index 00000000000..4f44ddebaef
--- /dev/null
+++ b/pkgs/applications/video/netflix/default.nix
@@ -0,0 +1,56 @@
+{ fetchurl
+, google-chrome
+, lib
+, makeDesktopItem
+, runtimeShell
+, symlinkJoin
+, writeScriptBin
+}:
+
+let
+  name = "netflix-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} \
+      --app=https://netflix.com \
+      --no-first-run --no-default-browser-check --no-crash-upload
+  '';
+
+in
+
+symlinkJoin {
+  inherit name meta;
+  paths = [ script desktopItem ];
+}