nix-dotfiles/modules/hm/webapp.nix
2023-11-01 14:08:53 +01:00

98 lines
2.4 KiB
Nix

{ pkgs, lib, ... }:
# Categories: https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry
let
chrome-cmd = link: "${pkgs.google-chrome}/bin/google-chrome-stable --app=${link}";
# firefox-cmd = link: "firefox --new-window ${link}";
webAppBuilder =
{ desktopName
, name ? builtins.replaceStrings [ " " ] [ "_" ] desktopName
, link
, cmd ? chrome-cmd
, icon ? lib.toLower name
, comment ? null
, categories ? [ "Network" ]
}:
pkgs.makeDesktopItem {
inherit name icon desktopName comment categories;
exec = cmd link;
};
links = [
{
desktopName = "Microsoft Teams";
link = "https://teams.microsoft.com";
categories = [ "Office" ];
}
{
desktopName = "Chess.com";
link = "https://chess.com";
categories = [ "Game" ];
}
{
desktopName = "Google Calendar";
link = "https://google.com/calendar";
categories = [ "Office" ];
}
{
desktopName = "Google Keep";
link = "https://keep.google.com";
categories = [ "Office" ];
}
{
desktopName = "Google Play Books";
link = "https://play.google.com/books";
categories = [ "Office" "Viewer" ];
}
# {
# desktopName = "Mendeley";
# link =
# "https://www.mendeley.com/reference-manager/library/all-references";
# categories = [ "Office" ];
# }
{
desktopName = "Monkeytype";
link = "https://monkeytype.com/";
categories = [ "Game" ];
}
{
desktopName = "Netflix";
link = "https://www.netflix.com";
categories = [ "AudioVideo" ];
}
{
desktopName = "Notion";
link = "https://notion.so";
categories = [ "Office" ];
}
{
desktopName = "Prime Video";
link = "https://primevideo.com";
categories = [ "AudioVideo" ];
}
{
desktopName = "Protonmail";
link = "https://mail.protonmail.com";
categories = [ "Office" ];
}
{
desktopName = "Twitch";
link = "https://www.twitch.tv";
categories = [ "AudioVideo" ];
}
{
desktopName = "WhatsApp";
link = "https://web.whatsapp.com/";
}
{
desktopName = "YouTube";
link = "https://www.youtube.com";
categories = [ "AudioVideo" ];
}
{
desktopName = "Plex";
link = "https://app.plex.tv";
categories = [ "AudioVideo" ];
}
];
in
{ home.packages = map webAppBuilder links; }