I am using Nix on Ubuntu. I am trying to run GUI apps installed via Nix. For this example: vscode
I am managing my profiles with home-manager.
home.nix:
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "vandy";
home.homeDirectory = "/home/vandy";
# Enable Graphical Services
xsession.enable = true;
xsession.windowManager.command = "…";
nixGL.packages = import <nixgl> { inherit pkgs; };
nixGL.defaultWrapper = "mesa"; # Default wrapper for general use
nixGL.offloadWrapper = "nvidiaPrime"; # Wrapper for NVIDIA GPU offloading
nixGL.installScripts = [ "mesa" "nvidiaPrime" ];
home.packages = [
(config.lib.nixGL.wrap pkgs.vscode)
];
home.stateVersion = "25.05"; # Please read the comment before changing.
home.file = {
};
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
However when I try to launch vscode via terminal, it doesn’t launch. I am unable to figure out why. What am I doing wrong here. I tried with and without the NixGL wrapper.
user@users ~> code --verbose
Warning: 'ozone-platform-hint' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'enable-wayland-ime' is not in the list of known options, but still passed to Electron/Chromium.
[9321:0608/133151.970543:FATAL:setuid_sandbox_host.cc(163)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /nix/store/n71p521p4gngr8mxrhh00hqrarbfpvar-vscode-1.100.2/lib/vscode/chrome-sandbox is owned by root and has mode 4755.
The -v flag was for version and not verbose lol. I was able to fix it (for now) by running it in no sandbox modecode --no-sandbox.