Compare commits

..

No commits in common. "998f2da70ee862e17615130caa47d676e568e51f" and "fe3ceceb58b9522556942bc88c06e41d9a4fab6c" have entirely different histories.

7 changed files with 71 additions and 38 deletions

View file

@ -6,6 +6,9 @@
...
}:
let
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
in
{
imports = [ ./../../home-manager/modules/machine.nix ];
@ -21,5 +24,7 @@
nixpkgs.config.allowUnfree = true;
nixGLPrefix = lib.getExe pkgs.nixgl.nixGLIntel;
nix.settings.builders = "@/etc/nix/machines";
}

View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1734036866,
"narHash": "sha256-KqdRX+IGfD4PsPNu/0Uqda3JHBqqcY0LSt3dayY8voM=",
"lastModified": 1731102567,
"narHash": "sha256-A0xTZedeIwMceV86/BB3b6GgS+DVoqQwxywDgH68x7s=",
"owner": "dagger",
"repo": "nix",
"rev": "8f7e40ca59ad9f85d6dfe3de623fed9adf0d5bec",
"rev": "9852fdddcdcb52841275ffb6a39fa1524d538d5a",
"type": "github"
},
"original": {
@ -22,11 +22,11 @@
},
"flake-compat": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
@ -93,11 +93,11 @@
]
},
"locked": {
"lastModified": 1734344598,
"narHash": "sha256-wNX3hsScqDdqKWOO87wETUEi7a/QlPVgpC/Lh5rFOuA=",
"lastModified": 1733085484,
"narHash": "sha256-dVmNuUajnU18oHzBQWZm1BQtANCHaqNuxTHZQ+GN0r8=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "83ecd50915a09dca928971139d3a102377a8d242",
"rev": "c1fee8d4a60b89cae12b288ba9dbc608ff298163",
"type": "github"
},
"original": {
@ -157,11 +157,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1734239219,
"narHash": "sha256-iKY/OGNANXpd9hXBGfx8vObpHW4IcOH0MrerLCCc7hA=",
"lastModified": 1731668526,
"narHash": "sha256-ZszfGYOrwol3MGFpttahldT+UOfqXckk6XwZrUyHLxE=",
"owner": "thiagokokada",
"repo": "nix-alien",
"rev": "a266d0f74dd4a82ec6a72b02fbf3fbc5f7105f15",
"rev": "97fe58a8ac15663b1ecdebd84d2187eb71f8532d",
"type": "github"
},
"original": {
@ -193,11 +193,11 @@
]
},
"locked": {
"lastModified": 1734234111,
"narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=",
"lastModified": 1731593150,
"narHash": "sha256-FvksinoI2Y6kuwH+cKBu1oDA8uPGfoRqgtQV6O8GDc4=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d",
"rev": "40d882b55e89add1ded379cc99edaab24983d6d9",
"type": "github"
},
"original": {
@ -213,11 +213,11 @@
]
},
"locked": {
"lastModified": 1734234111,
"narHash": "sha256-icEMqBt4HtGH52PU5FHidgBrNJvOfXH6VQKNtnD1aw8=",
"lastModified": 1733024876,
"narHash": "sha256-vy9Q41hBE7Zg0yakF79neVgb3i3PQMSMR7uHPpPywFE=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "311d6cf3ad3f56cb051ffab1f480b2909b3f754d",
"rev": "6e0b7f81367069589a480b91603a10bcf71f3103",
"type": "github"
},
"original": {
@ -249,11 +249,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733940404,
"narHash": "sha256-Pj39hSoUA86ZePPF/UXiYHHM7hMIkios8TYG29kQT4g=",
"lastModified": 1731319897,
"narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5d67ea6b4b63378b9c13be21e2ec9d1afc921713",
"rev": "dc460ec76cbff0e66e269457d7b728432263166c",
"type": "github"
},
"original": {
@ -271,11 +271,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1734260421,
"narHash": "sha256-vsr+9xKkirwEjvXTS2sOVIxlKQmF/QjszD+Ph0/oRgc=",
"lastModified": 1732958734,
"narHash": "sha256-DY1Aq+pAU/n0loBjCRfeSbEG/ji2M+mrEkcEnsN/AHk=",
"owner": "ryantm",
"repo": "nixpkgs-update",
"rev": "712e24bd6543801c52f6c0656a8371f8d029030e",
"rev": "dffb2930904b08ca8d226594b543cbae150b5f67",
"type": "github"
},
"original": {
@ -286,11 +286,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1734424634,
"narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=",
"lastModified": 1732837521,
"narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33",
"rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370",
"type": "github"
},
"original": {

View file

@ -2,7 +2,6 @@
lib,
pkgs,
config,
inputs,
...
}:
with lib;
@ -82,13 +81,6 @@ with lib;
news.display = "silent";
targets.genericLinux.enable = config.machine.isGeneric;
nixGL = {
packages = inputs.nixgl.packages;
defaultWrapper = "mesa";
installScripts = ["mesa"];
vulkan.enable = true;
};
home = {
username = "${config.machine.username}";
homeDirectory = "/home/${config.machine.username}";

View file

@ -8,7 +8,7 @@
with lib;
let
nixGL = config.lib.nixGL.wrap;
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
electronFlags = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime --disable-gpu-shader-disk-cache -n";
in
{

View file

@ -6,7 +6,7 @@
}:
let
nixGL = config.lib.nixGL.wrap;
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
in
{
programs.alacritty = {

View file

@ -5,7 +5,7 @@
}:
let
nixGL = config.lib.nixGL.wrap;
nixGL = import ./../../home-manager/utils/nixGLWrap.nix { inherit pkgs config; };
in
{
programs.kitty = {

View file

@ -0,0 +1,36 @@
# Call once on import to load global context
{ pkgs, config }:
# Wrap a single package
pkg:
if config.nixGLPrefix == "" then
pkg
else
# 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\" ${config.nixGLPrefix} $file \"\$@\"" >> "$out/bin/$(basename $file)"
chmod +x "$out/bin/$(basename $file)"
done
shopt -u nullglob # Revert nullglob back to its normal default state
'';
}))