nix-git/modules/freetube.nix

37 lines
1.4 KiB
Nix
Raw Normal View History

2023-10-18 17:47:26 +02:00
{ config, pkgs, lib, ... }:
{
2023-11-05 17:12:06 +01:00
# TODO: We use unstable until Electron is upgraded to higher than 22, e.g. to 27
# permalink: https://github.com/NixOS/nixpkgs/blob/60b9db998f71ea49e1a9c41824d09aa274be1344/pkgs/applications/video/freetube/default.nix#L1
# current master: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/video/freetube/default.nix#L1
2023-10-18 17:47:26 +02:00
users.users.yoda = {
packages = with pkgs; [
2023-11-05 17:12:06 +01:00
unstable.freetube # YouTube client.
2023-10-18 17:47:26 +02:00
];
};
# 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"
# )
# '';
# });
# })
];
}