Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save superherointj/35e00710dd170e247c7ec9feb948a14e to your computer and use it in GitHub Desktop.
Save superherointj/35e00710dd170e247c7ec9feb948a14e to your computer and use it in GitHub Desktop.
nvidia-desktop-gtx-780ti.nix
services = {
xserver = {
enable = true;
videoDrivers = [ "intel" "nvidia" ];
config = ''
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
Section "Device"
Identifier "GeForce GTX 780 Ti"
Driver "nvidia"
BusId "PCI:1:0:0"
Option "TearFree" "true"
EndSection
'';
};
};
@superherointj
Copy link
Author

superherointj commented May 28, 2021

# O driver é proprietário. Precisa permitir ele:
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
    "nvidia-x11"
    "nvidia-settings"
  ];

@superherointj
Copy link
Author

superherointj commented May 28, 2021

  boot.plymouth.enable = true;

  services.xserver = {
    desktopManager.xterm.enable = false;
    enable = true;
    layout = "us";
    xkbVariant = "intl";
    # xkbModel = "pc104";
    # xkbOptions = "grp:alt_shift_toggle";
    deviceSection = ''
      Option "TearFree" "true"
    '';
    windowManager.i3 = {
      enable = true;
      package = pkgs.i3-gaps;
    };
    displayManager = {
      lightdm.enable = true;
      autoLogin.enable = true;
      autoLogin.user = "intj";
    };
  };

  # Compositor (supposedly fixes screen tearing).
  services.compton.enable = true;

  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true;
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment