The Complete Computing Environment

NixGL

LifeTechEmacsTopicsArcology

NixGL builds little wrapper programs which use the system libGL or nvidia libraries to run nixpkgs/home-manager programs which need OpenGL or whatever.

nixGL Wrapper helper

This plugs in to CCE Hypermedia to make it somewhat more durable to create functional wrappers for nixGL:

{ pkgs, stdenv, ... }:

{ name, package_name ? name, pkg ? null }:
let
  nixGL = pkgs.nixGL;
  pkg_to_shadow = if (isNull pkg)
                  then pkgs."${package_name}"
                  else pkg;
in
pkgs.symlinkJoin {
  inherit name;
  paths = [
    (pkgs.writeScriptBin name ''
       #!${pkgs.stdenv.shell}
       exec ${nixGL}/bin/nixGLIntel ${pkg_to_shadow}/bin/${name} $@
     '')
    pkg_to_shadow
  ];
}
{ stdenv, pkgs ? import <nixpkgs> {}, ... }:

let
  nixGLghOptions = pkgs.lib.pkgVersions.nixGL;
  nixGLgh = pkgs.callPackage nixGLghOptions {};
  nixGL = (pkgs.callPackage nixGLgh {}).nixGLIntel;
in
  nixGL

NEXT mark this for tangling in home-manager somehow…