diff --git a/hardware/gpu/cuda.nix b/hardware/gpu/cuda.nix index 1b68b16..a838a7b 100644 --- a/hardware/gpu/cuda.nix +++ b/hardware/gpu/cuda.nix @@ -88,7 +88,18 @@ lib.mkMerge [ environment.systemPackages = [ (pkgs.nvtopPackages.nvidia or pkgs.nvtop-nvidia) - ] ++ lib.optionals config.hardware.nvidia.prime.offload.enable [ + ]; + +} +# (lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "25.11") { +# hardware.nvidia.prime.offload = { +# enableOffloadCmd = config.hardware.nvidia.prime.offload.enable; +# offloadCmdMainProgram = "prime-run"; +# }; +# }) +# (lib.optionalAttrs (lib.versionOlder (lib.versions.majorMinor lib.version) "25.11") { +{ + environment.systemPackages = lib.optionals config.hardware.nvidia.prime.offload.enable [ (pkgs.writeShellScriptBin "prime-run" '' export __NV_PRIME_RENDER_OFFLOAD=1 export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 @@ -105,6 +116,9 @@ lib.mkMerge [ # exec "$@" #'') ]; +# }) +} +{ # nvidia bad nixpkgs.config.packageOverrides = pkgs: { diff --git a/users/pbsds/home/profiles/bashrc.d/nix-fd.sh b/users/pbsds/home/profiles/bashrc.d/nix-fd.sh index f842751..5f5d321 100644 --- a/users/pbsds/home/profiles/bashrc.d/nix-fd.sh +++ b/users/pbsds/home/profiles/bashrc.d/nix-fd.sh @@ -64,3 +64,8 @@ nix-fd() { _nix_fd "nix" "$@"; } if command -v nom >/dev/null; then nom-fd() { _nix_fd "nom" "$@"; } fi + +nixfd() { + echo >&2 "did you mean 'nix-fd'?" + false +} diff --git a/users/pbsds/home/profiles/bashrc.d/nix-shell.sh b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh index 7266aa2..8d27378 100644 --- a/users/pbsds/home/profiles/bashrc.d/nix-shell.sh +++ b/users/pbsds/home/profiles/bashrc.d/nix-shell.sh @@ -170,3 +170,8 @@ ne() { printf >&2 "+ cd %q\n" "$storepath" cd "$storepath" } + +# TODO: add a 'enable-unfree' command which switches the NIX_CONFIG with a file +# where https://nix.dev/manual/nix/2.26/command-ref/conf-file#conf-impure-env is +# set with NIXPKGS_ALLOW_UNFREE. +# blocked on lix support for the option