nixos/hosts/sparky/default.nix

91 lines
2.2 KiB
Nix
Raw Normal View History

2024-06-10 14:05:06 +01:00
{ inputs, config, lib, pkgs, outputs, ... }:
2024-05-27 16:19:00 +01:00
let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
2024-05-28 20:19:30 +01:00
dev = "/dev/sda"; # depends on target hardware
2024-05-27 16:19:00 +01:00
encrypted = false; # currrently only applies to btrfs
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root";
2024-06-28 20:21:27 +01:00
impermanence = true;
2024-05-27 16:19:00 +01:00
in
2024-05-16 11:55:24 +01:00
{
imports =
2024-05-26 13:23:35 +01:00
[
2024-05-23 00:10:58 +01:00
# Create users for this host
../common/users/media
2024-05-27 16:19:00 +01:00
# Disk configuration
inputs.disko.nixosModules.disko
2024-06-28 20:21:27 +01:00
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; })
2024-05-27 16:19:00 +01:00
# Impermanence
2024-06-28 20:21:27 +01:00
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
2024-05-27 16:19:00 +01:00
2024-05-16 11:55:24 +01:00
# Import core options
./hardware-configuration.nix
../common/core
# Import optional options
../common/optional/openssh.nix
../common/optional/persistence.nix
2024-08-20 13:14:24 +01:00
../common/optional/nfs-mounts/media.nix
2024-06-15 01:31:56 +01:00
../common/optional/gaming.nix
../common/optional/printing.nix
2024-05-16 11:55:24 +01:00
];
2024-05-16 20:19:01 +01:00
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
timeout = 3;
};
};
2024-05-29 19:49:31 +01:00
boot.kernelParams = [ "i915.enable_psr=0" ];
2024-05-16 20:19:01 +01:00
networking = {
2024-05-17 20:17:53 +01:00
hostName = "sparky";
2024-05-16 20:19:01 +01:00
networkmanager.enable = true;
enableIPv6 = false;
};
2024-05-29 20:14:20 +01:00
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
# Add additional package names here
"nvidia-x11"
"nvidia-settings"
"nvidia-persistenced"
];
2024-05-23 19:41:54 +01:00
services.displayManager.defaultSession = "cinnamon";
2024-05-29 19:49:31 +01:00
services.libinput.enable = true;
2024-05-23 19:41:54 +01:00
2024-05-24 14:32:18 +01:00
services.xserver = {
enable = true;
2024-05-29 20:14:20 +01:00
videoDrivers = [ "nvidia" ];
2024-05-24 14:32:18 +01:00
displayManager.lightdm.enable = true;
2024-05-29 19:49:31 +01:00
exportConfiguration = true;
deviceSection = ''
'';
2024-05-24 14:32:18 +01:00
desktopManager = {
cinnamon.enable = true;
2024-06-10 14:05:06 +01:00
};
2024-05-24 14:32:18 +01:00
};
2024-05-29 20:14:20 +01:00
# 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;
};
2024-05-16 20:19:01 +01:00
}