1
0
nixfiles/pkgs/chromium-incognito/default.nix

37 lines
1.2 KiB
Nix

{ pkgs, ... }:
let
chromium-incognito-wrapper = pkgs.writeShellScriptBin "chromium" ''
${pkgs.ungoogled-chromium}/bin/chromium --incognito "$@"
'';
in pkgs.stdenv.mkDerivation {
pname = "chromium-incognito";
version = "0.1.0";
src = pkgs.writeTextDir "chromium-incognito.desktop" ''
[Desktop Entry]
Version=1.0
Name=Chromium Incognito
Exec=${chromium-incognito-wrapper}/bin/chromium %U
StartupNotify=true
Terminal=false
Icon=chromium
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;
[Desktop Action new-window]
Name=New Incognito Window
Exec=${chromium-incognito-wrapper}/bin/chromium
'';
buildPhase = ''
mkdir -p $out/bin
ln -s ${chromium-incognito-wrapper}/bin/chromium $out/bin
install -D chromium-incognito.desktop $out/share/applications/chromium-incognito.desktop
ln -s ${pkgs.ungoogled-chromium}/share/icons $out/share
'';
meta.mainProgram = "chromium";
}