Compare commits
2 Commits
aa96b9e6ab
...
d7c499dde1
Author | SHA1 | Date |
---|---|---|
Pegasust | d7c499dde1 | |
Pegasust | 1c36b5c957 |
|
@ -180,7 +180,7 @@
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1,
|
"lastModified": 1,
|
||||||
"narHash": "sha256-KP+2qdZlhmRkrafuuEofg7YnNdVmGV95ipvpuqmJneI=",
|
"narHash": "sha256-GgIXbuHvwReBHZUyfSKS6DET3CfD6EEKABj6ndpcqHQ=",
|
||||||
"path": "./../../out-of-tree/nixGL",
|
"path": "./../../out-of-tree/nixGL",
|
||||||
"type": "path"
|
"type": "path"
|
||||||
},
|
},
|
||||||
|
|
|
@ -77,37 +77,10 @@ let
|
||||||
fetchurl { inherit url sha256; };
|
fetchurl { inherit url sha256; };
|
||||||
useGLVND = true;
|
useGLVND = true;
|
||||||
});
|
});
|
||||||
in
|
|
||||||
{
|
|
||||||
inherit nvidiaDrivers;
|
|
||||||
nvidiaLibsOnly = nvidiaDrivers.override {
|
nvidiaLibsOnly = nvidiaDrivers.override {
|
||||||
libsOnly = true;
|
libsOnly = true;
|
||||||
kernel = null;
|
kernel = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixGLNvidiaBumblebee = writeExecutable {
|
|
||||||
name = "nixGLNvidiaBumblebee-${version}";
|
|
||||||
text = ''
|
|
||||||
#!${runtimeShell}
|
|
||||||
export LD_LIBRARY_PATH=${
|
|
||||||
lib.makeLibraryPath [ nvidiaDrivers ]
|
|
||||||
}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
||||||
${
|
|
||||||
bumblebee.override {
|
|
||||||
nvidia_x11 = nvidiaDrivers;
|
|
||||||
nvidia_x11_i686 = nvidiaDrivers.lib32;
|
|
||||||
}
|
|
||||||
}/bin/optirun --ldpath ${
|
|
||||||
lib.makeLibraryPath ([ libglvnd nvidiaDrivers ]
|
|
||||||
++ lib.optionals enable32bits [
|
|
||||||
nvidiaDrivers.lib32
|
|
||||||
pkgsi686Linux.libglvnd
|
|
||||||
])
|
|
||||||
} "$@"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# TODO: 32bit version? Not tested.
|
|
||||||
nixNvidiaWrapper = api:
|
nixNvidiaWrapper = api:
|
||||||
writeExecutable {
|
writeExecutable {
|
||||||
name = "nix${api}Nvidia-${version}";
|
name = "nix${api}Nvidia-${version}";
|
||||||
|
@ -142,6 +115,34 @@ let
|
||||||
exec "$@"
|
exec "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit nvidiaDrivers nvidiaLibsOnly;
|
||||||
|
|
||||||
|
nixGLNvidiaBumblebee = writeExecutable {
|
||||||
|
name = "nixGLNvidiaBumblebee-${version}";
|
||||||
|
text = ''
|
||||||
|
#!${runtimeShell}
|
||||||
|
export LD_LIBRARY_PATH=${
|
||||||
|
lib.makeLibraryPath [ nvidiaDrivers ]
|
||||||
|
}"''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||||
|
${
|
||||||
|
bumblebee.override {
|
||||||
|
nvidia_x11 = nvidiaDrivers;
|
||||||
|
nvidia_x11_i686 = nvidiaDrivers.lib32;
|
||||||
|
}
|
||||||
|
}/bin/optirun --ldpath ${
|
||||||
|
lib.makeLibraryPath ([ libglvnd nvidiaDrivers ]
|
||||||
|
++ lib.optionals enable32bits [
|
||||||
|
nvidiaDrivers.lib32
|
||||||
|
pkgsi686Linux.libglvnd
|
||||||
|
])
|
||||||
|
} "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: 32bit version? Not tested.
|
||||||
|
inherit nixNvidiaWrapper;
|
||||||
|
|
||||||
# TODO: 32bit version? Not tested.
|
# TODO: 32bit version? Not tested.
|
||||||
nixGLNvidia = nixNvidiaWrapper "GL";
|
nixGLNvidia = nixNvidiaWrapper "GL";
|
||||||
|
|
|
@ -8,16 +8,17 @@ echo "SCRIPT_DIR: ${SCRIPT_DIR}"
|
||||||
HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
|
HOME_MANAGER_DIR="${SCRIPT_DIR}/../nix-conf/home-manager"
|
||||||
|
|
||||||
# Mason is bad: it puts binaries onto xdg.data
|
# Mason is bad: it puts binaries onto xdg.data
|
||||||
|
# let's make mason starts fresh, just in case we introduce RPATH hacks
|
||||||
|
# that injects binary for Mason to use.
|
||||||
rm -rf ~/.local/share/nvim/mason
|
rm -rf ~/.local/share/nvim/mason
|
||||||
|
|
||||||
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
# test if we have home-manager, if not, attempt to use nix to put home-manager to
|
||||||
# our environment
|
# our environment
|
||||||
if [ $(home-manager >/dev/null 2>&1) ]; then
|
if [ $(home-manager >/dev/null 2>&1) ]; then
|
||||||
# highly likely we don't even have nix support to start with, so let's fix that
|
# highly likely we don't even have nix support to start with, so let's fix that
|
||||||
sudo mv /etc/
|
nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR $@"
|
||||||
nix-shell -p home-manager --run "home-manager switch --flake $HOME_MANAGER_DIR"
|
|
||||||
else
|
else
|
||||||
home-manager switch -b backup --flake "$HOME_MANAGER_DIR"
|
home-manager switch -b backup --flake "$HOME_MANAGER_DIR" $@
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue