Add nixGL for firefox, digikam
This commit is contained in:
parent
cb4bc91db3
commit
5c2120616f
|
@ -0,0 +1,34 @@
|
||||||
|
# Call once on import to load global context
|
||||||
|
{ pkgs, config }:
|
||||||
|
|
||||||
|
let nixGL = import <nixgl> {}; in
|
||||||
|
|
||||||
|
# Wrap a single package
|
||||||
|
pkg:
|
||||||
|
|
||||||
|
# Wrap the package's binaries with nixGL, while preserving the rest of
|
||||||
|
# the outputs and derivation attributes.
|
||||||
|
(pkg.overrideAttrs (old: {
|
||||||
|
name = "nixGL-${pkg.name}";
|
||||||
|
buildCommand = ''
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
${
|
||||||
|
# Heavily inspired by https://stackoverflow.com/a/68523368/6259505
|
||||||
|
pkgs.lib.concatStringsSep "\n" (map (outputName: ''
|
||||||
|
echo "Copying output ${outputName}"
|
||||||
|
set -x
|
||||||
|
cp -rs --no-preserve=mode "${pkg.${outputName}}" "''$${outputName}"
|
||||||
|
set +x
|
||||||
|
'') (old.outputs or [ "out" ]))}
|
||||||
|
|
||||||
|
rm -rf $out/bin/*
|
||||||
|
shopt -s nullglob # Prevent loop from running if no files
|
||||||
|
for file in ${pkg.out}/bin/*; do
|
||||||
|
echo "#!${pkgs.bash}/bin/bash" > "$out/bin/$(basename $file)"
|
||||||
|
echo "exec -a \"\$0\" ${nixGL.auto.nixGLDefault}/bin/nixGL $file \"\$@\"" >> "$out/bin/$(basename $file)"
|
||||||
|
chmod +x "$out/bin/$(basename $file)"
|
||||||
|
done
|
||||||
|
shopt -u nullglob # Revert nullglob back to its normal default state
|
||||||
|
'';
|
||||||
|
}))
|
|
@ -1,4 +1,6 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
let nixGL = import ./nixGL.nix { inherit pkgs config; };
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
mullvad-vpn
|
mullvad-vpn
|
||||||
|
@ -7,6 +9,7 @@
|
||||||
htop
|
htop
|
||||||
ollama
|
ollama
|
||||||
wget
|
wget
|
||||||
|
(nixGL firefox)
|
||||||
ripgrep
|
ripgrep
|
||||||
bat
|
bat
|
||||||
monolith
|
monolith
|
||||||
|
@ -18,6 +21,7 @@
|
||||||
obsidian
|
obsidian
|
||||||
dfc
|
dfc
|
||||||
anki
|
anki
|
||||||
|
(nixGL digikam)
|
||||||
deno
|
deno
|
||||||
nodejs_21
|
nodejs_21
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue