-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The generated .desktop files seem to point to the brave binary on the nix store at the time of creation, so for now I just sed them to the generic executable on path
- Loading branch information
Showing
1 changed file
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
{ | ||
config, | ||
inputs, | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
inherit (inputs.home-manager.lib) hm; | ||
in { | ||
programs.chromium = { | ||
enable = true; | ||
commandLineArgs = [ | ||
"--disable-gpu-compositing" # @TODO Remove after NVIDIA figures this out | ||
]; | ||
package = pkgs.brave; | ||
}; | ||
} | ||
in | ||
lib.mkIf (config.my.modules.gui.enable) { | ||
programs.chromium = { | ||
enable = true; | ||
commandLineArgs = [ | ||
"--disable-gpu-compositing" # @TODO Remove after NVIDIA figures this out | ||
]; | ||
package = pkgs.brave; | ||
}; | ||
|
||
home.activation.patchBraveWebapps = let | ||
inherit (config.programs.chromium) package; | ||
executable = package.meta.mainProgram; | ||
script = | ||
hm.dag.entryAfter | ||
["writeBoundary"] | ||
# bash | ||
'' | ||
# Patches webapps so that they point to the executable on path | ||
run --quiet \ | ||
find '${config.home.homeDirectory}/.local/share/applications' \ | ||
-type f -name 'brave-*.desktop' \ | ||
| xargs --no-run-if-empty \ | ||
sed --in-place 's,Exec=[^ ]*,Exec=${executable},g' | ||
''; | ||
in | ||
lib.mkIf (package == pkgs.brave) script; | ||
} |