fix: discord screen share

FINALLY, MY FUCKING GOD THIS IS WORKING
This commit is contained in:
Gustavo "Guz" L. de Mello
2024-01-15 14:40:08 -03:00
parent 84508ebd70
commit b9ae0a5f18
6 changed files with 292 additions and 22 deletions

287
flake.lock generated
View File

@@ -76,11 +76,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704100519, "lastModified": 1705335923,
"narHash": "sha256-SgZC3cxquvwTN07vrYYT9ZkfvuhS5Y1k1F4+AMsuflc=", "narHash": "sha256-jRyp+a89Y7Cb2V/NyIJpgu5gsND419bY16omCZWy+jc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "6e91c5df192395753d8e6d55a0352109cb559790", "rev": "b989db5900df4bd1a786f8afd8063dae09d89a8c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -89,6 +89,121 @@
"type": "github" "type": "github"
} }
}, },
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs",
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1705332646,
"narHash": "sha256-D/7HUGGYBZHn8Zjs8Agf2i8mL64uqksKEjXz1QAd80c=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "3c964a9fdc220250a85b1c498e5b6fad9390272f",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprland-protocols_2": {
"inputs": {
"nixpkgs": [
"xdg-desktop-portal-hyprland",
"nixpkgs"
],
"systems": [
"xdg-desktop-portal-hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
]
},
"locked": {
"lastModified": 1704287638,
"narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlang_2": {
"inputs": {
"nixpkgs": [
"xdg-desktop-portal-hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1704287638,
"narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"nix-colors": { "nix-colors": {
"inputs": { "inputs": {
"base16-schemes": "base16-schemes", "base16-schemes": "base16-schemes",
@@ -115,11 +230,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1704596958, "lastModified": 1705282324,
"narHash": "sha256-BK3Ohsz7m8X6qVKFxDtr8KVcHipfr5hYE9PDIJevHbQ=", "narHash": "sha256-LnURMA7yCM5t7et9O2+2YfGQh0FKAfE5GyahNDDzJVM=",
"owner": "Mic92", "owner": "Mic92",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "f46800ac5a6e9f892fe36e50821c5d85794ecc62", "rev": "49aaeecf41ae0a0944e2c627cb515bcde428a1d1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -130,15 +245,15 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1703961334, "lastModified": 1705133751,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
@@ -161,11 +276,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1704290814, "lastModified": 1705033721,
"narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", "narHash": "sha256-K5eJHmL1/kev6WuqyqqbS1cdNnSidIZ3jeqJ7GbrYnQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", "rev": "a1982c92d8980a0114372973cbdfe0a307f1bdea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -175,16 +290,50 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1705133751,
"narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1703961334,
"narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"firefox-addons": "firefox-addons", "firefox-addons": "firefox-addons",
"flatpaks": "flatpaks", "flatpaks": "flatpaks",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland",
"nix-colors": "nix-colors", "nix-colors": "nix-colors",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"tmux-plugin-manager": "tmux-plugin-manager" "tmux-plugin-manager": "tmux-plugin-manager",
"xdg-desktop-portal-hyprland": "xdg-desktop-portal-hyprland"
} }
}, },
"sops-nix": { "sops-nix": {
@@ -195,11 +344,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1704908274, "lastModified": 1705201153,
"narHash": "sha256-74W9Yyomv3COGRmKi8zvyA5tL2KLiVkBeaYmYLjXyOw=", "narHash": "sha256-y0/a4IMDZrc7lAkR7Gcm5R3W2iCBiARHnYZe6vkmiNE=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c0b3a5af90fae3ba95645bbf85d2b64880addd76", "rev": "70dd0d521f7849338e487a219c1a07c429a66d77",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -208,6 +357,36 @@
"type": "github" "type": "github"
} }
}, },
"systems": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"tmux-plugin-manager": { "tmux-plugin-manager": {
"flake": false, "flake": false,
"locked": { "locked": {
@@ -223,6 +402,76 @@
"repo": "tpm", "repo": "tpm",
"type": "github" "type": "github"
} }
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1703963193,
"narHash": "sha256-ke8drv6PTrdQDruWbajrRJffP9A9PU6FRyjJGNZRTs4=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "f81c3d93cd6f61b20ae784297679283438def8df",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "f81c3d93cd6f61b20ae784297679283438def8df",
"type": "gitlab"
}
},
"xdg-desktop-portal-hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols_2",
"hyprlang": "hyprlang_2",
"nixpkgs": "nixpkgs_3",
"systems": "systems_2"
},
"locked": {
"lastModified": 1704659450,
"narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "6a5de92769d5b7038134044053f90e7458f6a197",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"hyprlang": "hyprlang",
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1704659450,
"narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "6a5de92769d5b7038134044053f90e7458f6a197",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@@ -36,6 +36,20 @@
url = "github:tmux-plugins/tpm"; url = "github:tmux-plugins/tpm";
flake = false; flake = false;
}; };
# THANK YOU SO MUCH RadovanSk!!
# https://github.com/NixOS/nixpkgs/issues/277230#issuecomment-1878092466
hyprland.url = "github:hyprwm/Hyprland";
xdg-desktop-portal-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland";
/*
Note to self:
The last commit with working screen share, as the time of writing this, was
https://github.com/hyprwm/xdg-desktop-portal-hyprland/commit/6a5de92769d5b7038134044053f90e7458f6a197
https://github.com/hyprwm/Hyprland/commit/3c964a9fdc220250a85b1c498e5b6fad9390272f
so if needed, you can always roll-back.
Fuck discord.
*/
}; };
outputs = { self, nixpkgs, home-manager, ... }@inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:

View File

@@ -24,11 +24,12 @@
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
package = inputs.hyprland.packages."${pkgs.system}".hyprland;
portalPackage = inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland;
}; };
xdg.portal.enable = true; xdg.portal.enable = true;
xdg.portal.extraPortals = with pkgs; [ xdg.portal.extraPortals = with pkgs; [
xdg-desktop-portal-hyprland
xdg-desktop-portal-kde xdg-desktop-portal-kde
]; ];
@@ -38,6 +39,8 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
inputs.xdg-desktop-portal-hyprland.packages."${pkgs.system}".xdg-desktop-portal-hyprland
inputs.hyprland.packages."${pkgs.system}".hyprland
electron_28 electron_28
wlroots wlroots
kitty kitty

View File

@@ -42,7 +42,6 @@
services.flatpak.packages = [ services.flatpak.packages = [
"nz.mega.MEGAsync" "nz.mega.MEGAsync"
"md.obsidian.Obsidian" "md.obsidian.Obsidian"
# "dev.vencord.Vesktop"
]; ];
# services.flatpak.overrides = { }; # services.flatpak.overrides = { };
@@ -50,7 +49,7 @@
nixpkgs.config.allowUnfreePredicate = _: true; nixpkgs.config.allowUnfreePredicate = _: true;
home.packages = with pkgs; [ home.packages = with pkgs; [
## Programs ## Programs
vesktop webcord-vencord
# (pkgs.writeShellScriptBin "my-hello" '' # (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!" # echo "Hello, ${config.home.username}!"

View File

@@ -124,6 +124,10 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.package = inputs.hyprland.packages."${pkgs.system}".hyprland;
wayland.windowManager.hyprland.xwayland.enable = true;
wayland.windowManager.hyprland.systemd.enable = true;
wayland.windowManager.hyprland.settings = lib.mkMerge [ wayland.windowManager.hyprland.settings = lib.mkMerge [
# Sets monitor variables ("$name" = "id") so it can be used in rules later # Sets monitor variables ("$name" = "id") so it can be used in rules later

View File

@@ -57,6 +57,7 @@ in
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
wireplumber.enable = true;
#jack.enable = true; #jack.enable = true;
}; };