created mkWebApp and add yt music webapp

This commit is contained in:
William 2024-08-27 21:02:37 -03:00
parent 96f5c16e42
commit da0eddf1a2
3 changed files with 32 additions and 1 deletions

View file

@ -1,5 +1,5 @@
{ ... }: { ... }:
{ {
imports = [ ./home.nix ./programs.nix ./programs/wezterm.nix ]; imports = [ ./home.nix ./programs.nix ./programs ];
} }

View file

@ -0,0 +1,5 @@
{ ... }:
{
imports = [ ./wezterm.nix ./webapps.nix ];
}

View file

@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
let
mkWebApp = webAppName: webAppLink: webAppIconLink: webAppIconHash:
let name = lib.strings.replaceStrings [ " " ] [ "" ] webAppName;
in pkgs.makeDesktopItem {
inherit name;
icon = pkgs.fetchurl {
url = webAppIconLink;
sha256 = webAppIconHash;
};
desktopName = webAppName;
categories = [ "Network" ];
startupNotify = true;
startupWMClass = "chrome-${
lib.strings.replaceStrings [ "https://" "/" ] [ "" "" ] webAppLink
}__-Default";
exec =
"${pkgs.ungoogled-chromium}/bin/chromium --no-first-run --no-default-browser-check --no-crash-upload --app=${webAppLink} --class=${name}";
};
in {
home.packages = [
(mkWebApp "YT Music" "https://music.youtube.com"
"https://raw.githubusercontent.com/vinceliuice/Qogir-icon-theme/fff0c7f3747b9b9ddf94c6f997847d47896097c2/src/scalable/apps/youtube-music.svg"
"sha256-T+v2JOOW+nEwH/9W2PFOrw/315/bCoKHw01KNh2U8IE=")
];
}