uranus-config/saturnOS/system/default.nix
2023-11-18 01:52:18 +00:00

104 lines
2.6 KiB
Nix

#this is a template, but would be auto-generated by saturnConfig, when the system is first created and on later modification to the system options
# it is not reccomended to use this file, as it should be generated by the script only
{ config, pkgs, lib, ... }:
{
# importing custom user config
imports = [ ./custom.nix <home-manager/nixos> ];
# settings hostname
saturn.hostname = "uranus";
saturn.prettyHostname = "🪐 uranus";
# efi bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.initrd.systemd.enable = true;
boot.plymouth.enable = true;
boot.kernelParams = ["quiet"];
boot.supportedFilesystems = [ "bcachefs" ];
# configure networking
networking.networkmanager.enable = true;
# configure locale
time.timeZone = "Etc/UTC";
i18n.defaultLocale = "en_CA.UTF-8";
# enable the gnome browser extension
services.gnome.gnome-browser-connector.enable = true;
services.openssh.enable = true;
# configure x11
services.xserver = {
videoDrivers = [ "nvidia" ];
layout = "us";
xkbVariant = "";
};
# enable opengl
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
nvidia-vaapi-driver
];
};
hardware.nvidia = {
# Prime is needed for optimus GPU
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
# Modesetting is needed for most Wayland compositors
modesetting.enable = true;
# Use the open source version of the kernel module
# Only available on driver 515.43.04+
open = false;
# Enable the nvidia settings menu
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidia_x11_legacy470;
};
programs.gamemode = {
enable = true;
enableRenice = true;
settings = {
general.renice = 10;
gpu = {
apply_gpu_optimizations="accept-responsibility";
nv_powermizer_mode=2;
gpu_device=1;
};
};
};
# add and configure users
users.users.hive = {
initialPassword = "";
isNormalUser = true;
description = "The Hive";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "vboxusers" ];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.hive = import /home/hive/.config/home-manager/home.nix;
system.stateVersion = "23.05";
}