132 lines
2.8 KiB
Nix
132 lines
2.8 KiB
Nix
{ inputs, config, lib, pkgs, outputs, ... }:
|
|
let
|
|
# Disko setup
|
|
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
|
|
dev = "/dev/sda"; # depends on target hardware
|
|
encrypted = false; # currrently only applies to btrfs
|
|
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
|
|
in
|
|
{
|
|
imports =
|
|
[
|
|
# Create users for this host
|
|
../common/users/media
|
|
|
|
# Disk configuration
|
|
inputs.disko.nixosModules.disko
|
|
(import ../common/disks { device = dev; fsType = fsType; encrypted = encrypted; })
|
|
|
|
# Impermanence
|
|
inputs.impermanence.nixosModules.impermanence
|
|
(import ../common/disks/btrfs-impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
|
|
|
|
# Import core options
|
|
./hardware-configuration.nix
|
|
../common/core
|
|
|
|
# Import optional options
|
|
../common/optional/openssh.nix
|
|
../common/optional/persistence.nix
|
|
|
|
];
|
|
|
|
boot = {
|
|
loader = {
|
|
systemd-boot.enable = true;
|
|
efi.canTouchEfiVariables = true;
|
|
timeout = 3;
|
|
};
|
|
};
|
|
boot.kernelParams = [ "i915.enable_psr=0" ];
|
|
|
|
networking = {
|
|
hostName = "sparky";
|
|
networkmanager.enable = true;
|
|
enableIPv6 = false;
|
|
};
|
|
|
|
# Gaming
|
|
hardware.xone.enable = true;
|
|
environment.systemPackages = with pkgs; [
|
|
#Xbox controller
|
|
linuxKernel.packages.linux_zen.xone
|
|
|
|
# Steam
|
|
mangohud
|
|
gamemode
|
|
|
|
# WINE
|
|
wine
|
|
winetricks
|
|
protontricks
|
|
vulkan-tools
|
|
|
|
# Extra dependencies
|
|
# https://github.com/lutris/docs/
|
|
gnutls
|
|
openldap
|
|
libgpgerror
|
|
freetype
|
|
sqlite
|
|
libxml2
|
|
xml2
|
|
SDL2
|
|
];
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
|
builtins.elem (lib.getName pkg) [
|
|
# Add additional package names here
|
|
"nvidia-x11"
|
|
"nvidia-settings"
|
|
"nvidia-persistenced"
|
|
"steam"
|
|
"steam-original"
|
|
"steam-run"
|
|
];
|
|
|
|
programs.steam.enable = true;
|
|
programs.gamemode.enable = true;
|
|
nixpkgs.config.packageOverrides = pkgs: {
|
|
steam = pkgs.steam.override {
|
|
extraPkgs = pkgs: with pkgs; [
|
|
pango
|
|
libthai
|
|
harfbuzz
|
|
gamemode
|
|
];
|
|
};
|
|
};
|
|
|
|
services.displayManager.defaultSession = "cinnamon";
|
|
services.libinput.enable = true;
|
|
|
|
services.xserver = {
|
|
enable = true;
|
|
videoDrivers = [ "nvidia" ];
|
|
displayManager.lightdm.enable = true;
|
|
exportConfiguration = true;
|
|
deviceSection = ''
|
|
'';
|
|
desktopManager = {
|
|
cinnamon.enable = true;
|
|
};
|
|
};
|
|
|
|
# Enable OpenGL
|
|
hardware.opengl = {
|
|
enable = true;
|
|
driSupport = true;
|
|
driSupport32Bit = true;
|
|
};
|
|
|
|
# Load nvidia driver
|
|
hardware.nvidia = {
|
|
# https://nixos.wiki/wiki/Nvidia
|
|
modesetting.enable = true;
|
|
powerManagement.enable = false;
|
|
open = false;
|
|
nvidiaSettings = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
}
|