From 86b017ed4acaaf900cb22c03bbf3f45be8d89cb3 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 18 Oct 2023 17:47:26 +0200 Subject: [PATCH] freetube on Wayland --- hosts/yodaNas/configuration.nix | 1 + hosts/yodaTab/configuration.nix | 1 + hosts/yodaTux/configuration.nix | 1 + hosts/yodaYoga/configuration.nix | 1 + modules/freetube.nix | 32 ++++++++++++++++++++++++++++++++ modules/programs.nix | 1 - 6 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 modules/freetube.nix diff --git a/hosts/yodaNas/configuration.nix b/hosts/yodaNas/configuration.nix index 9e1c5c1..4e01a28 100644 --- a/hosts/yodaNas/configuration.nix +++ b/hosts/yodaNas/configuration.nix @@ -20,6 +20,7 @@ #../../modules/programs.nix #../../modules/boxes.nix + #../../modules/freetube.nix #../../modules/signal-desktop.nix #../../modules/element-desktop.nix #../../modules/tor-browser.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index 104ba0a..876852f 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -19,6 +19,7 @@ ../../modules/programs.nix #../../modules/boxes.nix + ../../modules/freetube.nix ../../modules/signal-desktop.nix ../../modules/element-desktop.nix ../../modules/tor-browser.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 7df2afd..9fa24f3 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -19,6 +19,7 @@ ../../modules/programs.nix ../../modules/boxes.nix + ../../modules/freetube.nix ../../modules/signal-desktop.nix ../../modules/element-desktop.nix ../../modules/tor-browser.nix diff --git a/hosts/yodaYoga/configuration.nix b/hosts/yodaYoga/configuration.nix index 45556e4..3631818 100644 --- a/hosts/yodaYoga/configuration.nix +++ b/hosts/yodaYoga/configuration.nix @@ -20,6 +20,7 @@ #../../modules/programs.nix #../../modules/boxes.nix + #../../modules/freetube.nix #../../modules/signal-desktop.nix #../../modules/element-desktop.nix #../../modules/tor-browser.nix diff --git a/modules/freetube.nix b/modules/freetube.nix new file mode 100644 index 0000000..f1971e1 --- /dev/null +++ b/modules/freetube.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, ... }: +{ + users.users.yoda = { + packages = with pkgs; [ + freetube # YouTube client. + ]; + }; + + # Manually enable Wayland support. + # Method1: https://www.reddit.com/r/NixOS/comments/scf0ui/comment/hu6xfn8/?utm_source=share&utm_medium=web2x&context=3 + # Method2: https://github.com/NixOS/nixpkgs/issues/222043#issuecomment-1493457041 + nixpkgs.overlays = lib.mkIf (config.services.xserver.displayManager.gdm.wayland) [ + (final: prev: { + freetube = prev.freetube.overrideAttrs (oldAttrs: { + postInstall = (oldAttrs.postInstall or "") + '' + substituteInPlace $out/share/applications/freetube.desktop \ + --replace "Exec=freetube" "Exec=freetube --enable-features=UseOzonePlatform --ozone-platform=wayland" + ''; + }); + }) +# (self: super: { +# freetube = super.freetube.overrideAttrs (old: { +# preFixup = (old.preFixup or "") + '' +# gappsWrapperArgs+=( +# --add-flags "--enable-features=UseOzonePlatform" +# --add-flags "--ozone-platform=wayland" +# ) +# ''; +# }); +# }) + ]; +} diff --git a/modules/programs.nix b/modules/programs.nix index 0364f58..f90d81f 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -34,7 +34,6 @@ gnome-secrets # Password manager (Native Wayland client) #keepassxc # Password manager - freetube # YouTube client tartube-yt-dlp # Video downloader (front-end for yt-dlp) joplin-desktop # Markdown notes rnote # Handwritten notes