fix: add wrapper util for home manager modules

This commit is contained in:
2026-02-23 15:37:51 +01:00
parent 624a56e948
commit ab59c50520
5 changed files with 20 additions and 28 deletions

View File

@@ -1,19 +1,7 @@
{ config, pkgs, ... }:
let
needsNixGL = config.lib ? nixGL;
bruno =
if needsNixGL then
pkgs.bruno.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
wrapProgram $out/bin/bruno --add-flags "--no-sandbox"
'';
})
else
pkgs.bruno;
in
{
config = {
home.packages = [ (config.nixgl.wrap bruno) ];
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.bruno "--no-sandbox")) ];
};
}

View File

@@ -4,8 +4,9 @@
pkgs,
...
}:
{
config = lib.mkIf config.comms.signal.enable {
home.packages = [ (config.nixgl.wrap pkgs.signal-desktop) ];
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.signal-desktop "--no-sandbox")) ];
};
}

View File

@@ -7,6 +7,6 @@
{
config = lib.mkIf config.comms.teams.enable {
home.packages = [ (config.nixgl.wrap pkgs.teams-for-linux) ];
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.teams-for-linux "--no-sandbox")) ];
};
}

View File

@@ -6,4 +6,19 @@
default = if config.lib ? nixGL then config.lib.nixGL.wrap else lib.id;
readOnly = true;
};
options.wrapApp = lib.mkOption {
type = lib.types.raw;
default =
pkg: flags:
if config.lib ? nixGL then
pkg.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
wrapProgram $out/bin/${pkg.meta.mainProgram} --add-flags "${flags}"
'';
})
else
pkg;
readOnly = true;
};
}

View File

@@ -1,19 +1,7 @@
{ config, pkgs, ... }:
let
needsNixGL = config.lib ? nixGL;
vscode =
if needsNixGL then
pkgs.vscode.overrideAttrs (old: {
postInstall = (old.postInstall or "") + ''
wrapProgram $out/bin/code --add-flags "--disable-gpu-sandbox"
'';
})
else
pkgs.vscode;
in
{
config = {
home.packages = [ (config.nixgl.wrap vscode) ];
home.packages = [ (config.nixgl.wrap (config.wrapApp pkgs.vscode "--disable-gpu-sandbox")) ];
};
}