feat(binto): add nvidia.nix and move some hm stuff to modules

This commit is contained in:
matt1432 2023-10-17 17:53:10 -04:00
parent 9b4e7fac44
commit 8ea9debb5a
13 changed files with 96 additions and 52 deletions

View file

@ -26,6 +26,11 @@
}; };
}; };
services.xserver = {
layout = "ca";
xkbVariant = "multix";
};
home-manager.users = let home-manager.users = let
default = { default = {
imports = [ imports = [

View file

@ -1,23 +0,0 @@
{ ... }:
{
users.users.matt = {
isNormalUser = true;
extraGroups = [ "wheel" "input" "uinput" "adm" "mlocate" "video" "libvirtd" ];
};
programs.dconf.enable = true;
# TODO: use hm for tmux
home-manager.users = {
matt = {
imports = [
../wim/home/dconf.nix
../wim/home/firefox/main.nix
];
home.stateVersion = "23.11";
};
};
}

View file

@ -10,13 +10,9 @@
../../modules/kmscon.nix ../../modules/kmscon.nix
../../modules/printer.nix ../../modules/printer.nix
./binto.nix ./modules/nvidia.nix
]; ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = [ "ntfs" ];
networking = { networking = {
hostName = "binto"; hostName = "binto";
networkmanager.enable = true; networkmanager.enable = true;
@ -27,32 +23,49 @@
time.timeZone = "America/Toronto"; time.timeZone = "America/Toronto";
# Enable the X11 windowing system. # Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the KDE Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = { services.xserver = {
layout = "ca"; enable = true;
xkbVariant = "multix";
# Enable the KDE Plasma Desktop Environment.
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
}; };
services.tailscale = { services = {
enable = true; tailscale = {
extraUpFlags = [ enable = true;
"--login-server https://headscale.nelim.org" extraUpFlags = [
"--operator=matt" "--login-server https://headscale.nelim.org"
]; "--operator=matt"
];
};
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
}; };
# Enable the OpenSSH daemon. users.users.matt = {
services.openssh = { isNormalUser = true;
enable = true; extraGroups = [ "wheel" "input" "uinput" "adm" "mlocate" "video" "libvirtd" ];
settings = { };
PasswordAuthentication = false;
PermitRootLogin = "no"; programs.dconf.enable = true;
# TODO: use hm for tmux
home-manager.users = {
matt = {
imports = [
../../modules/dconf.nix
../../modules/firefox/main.nix
];
home.stateVersion = "23.11";
}; };
}; };

View file

@ -1,13 +1,19 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, modulesPath, ... }: { config, lib, modulesPath, pkgs, ... }:
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [ (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = [ "ntfs" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];

View file

@ -0,0 +1,40 @@
{ config, ... }:
{
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Do not disable this unless your GPU is unsupported or if you have a good reason to.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}

View file

@ -14,12 +14,13 @@
matt = { matt = {
imports = [ imports = [
./dconf.nix
./theme.nix ./theme.nix
./hyprland.nix ./hyprland.nix
./dotfiles.nix ./dotfiles.nix
./packages.nix ./packages.nix
./firefox/main.nix
../../../modules/dconf.nix
../../../modules/firefox/main.nix
]; ];
home.stateVersion = "23.05"; home.stateVersion = "23.05";

View file

@ -1,3 +1,5 @@
# Home-manager module
{ ... }: { { ... }: {
dconf.settings = { dconf.settings = {
"org/virt-manager/virt-manager/connections" = { "org/virt-manager/virt-manager/connections" = {