add speed factor

This commit is contained in:
Cyryl Płotnicki 2020-05-23 13:57:07 +01:00
parent c2271eac15
commit fd0fcc2712
4 changed files with 25 additions and 4 deletions

View file

@ -30,15 +30,12 @@
package = pkgs.fprintd-thinkpad;
};
hardware.nvidiaOptimus.disable = true;
hardware.nvidia.prime.sync.enable = false;
hardware.bumblebee.enable = false;
imports = [
/etc/nixos/hardware-configuration.nix
../../boot.nix
../../common.nix
../../gfx-intel.nix
../../gfx-nvidia-optimus.nix
../../zerotier.nix
../../distributed-builds.nix
../../virtualbox.nix

View file

@ -1,6 +1,7 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [
genpass
gdb lldb
wget git gnupg curl tmux htop atop pciutils powertop ripgrep-all fd dnsutils du-dust
( pass.withExtensions (ext: [ ext.pass-otp ext.pass-import ext.pass-genphrase ext.pass-audit ext.pass-update ]))

View file

@ -11,6 +11,7 @@
sshKey = "/home/cyryl/.ssh/id_ed25519";
system = "x86_64-linux";
maxJobs = 2;
speedFactor = 2;
supportedFeatures = [ "kvm" ];
mandatoryFeatures = [ ];
}
@ -20,6 +21,7 @@
sshKey = "/home/cyryl/.ssh/id_ed25519";
system = "x86_64-linux";
maxJobs = 2;
speedFactor = 1;
supportedFeatures = [ ];
mandatoryFeatures = [ ];
}

View file

@ -0,0 +1,21 @@
{ config, pkgs, ... }:
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec -a "$0" "$@"
'';
in
{
environment.systemPackages = [ nvidia-offload ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.prime.offload.enable = true;
hardware.nvidia.prime = {
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
}