89 lines
2.1 KiB
Nix
89 lines
2.1 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";
|
|
impermanence = true;
|
|
in
|
|
{
|
|
imports =
|
|
[
|
|
# Create users for this host
|
|
../common/users/media
|
|
|
|
# Disk configuration
|
|
inputs.disko.nixosModules.disko
|
|
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
|
|
|
|
# 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
|
|
../common/optional/gaming.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;
|
|
};
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
|
builtins.elem (lib.getName pkg) [
|
|
# Add additional package names here
|
|
"nvidia-x11"
|
|
"nvidia-settings"
|
|
"nvidia-persistenced"
|
|
];
|
|
|
|
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;
|
|
};
|
|
}
|