1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 07:09:45 +01:00
home-manager/tests/modules/programs/firefox/setup-firefox-mock-overlay.nix
bricked 792757f643
firefox: support firefox derivatives
Adds support for Firefox forks by introducing methods that create
generic configs and options. Additional configs and options can be
added in separate modules.
2024-07-28 23:53:08 +02:00

30 lines
757 B
Nix

modulePath:
{ config, lib, pkgs, ... }:
with lib;
let
cfg = getAttrFromPath modulePath config;
in {
nixpkgs.overlays = [
(self: super: {
"${cfg.wrappedPackageName}-unwrapped" =
pkgs.runCommandLocal "${cfg.wrappedPackageName}-0" {
meta.description = "I pretend to be ${cfg.name}";
passthru.gtk3 = null;
} ''
mkdir -p "$out"/{bin,lib}
touch "$out/bin/${cfg.wrappedPackageName}"
chmod 755 "$out/bin/${cfg.wrappedPackageName}"
'';
chrome-gnome-shell =
pkgs.runCommandLocal "dummy-chrome-gnome-shell" { } ''
mkdir -p $out/lib/mozilla/native-messaging-hosts
touch $out/lib/mozilla/native-messaging-hosts/dummy
'';
})
];
}