2024-10-07 14:19:27 +01:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
configVars,
|
|
|
|
...
|
|
|
|
}: let
|
2024-05-27 16:19:00 +01:00
|
|
|
# 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
|
2024-10-07 14:19:27 +01:00
|
|
|
btrfsMountDevice =
|
|
|
|
if encrypted
|
|
|
|
then "/dev/mapper/crypted"
|
|
|
|
else "/dev/root_vg/root";
|
2024-06-28 20:21:27 +01:00
|
|
|
impermanence = true;
|
2024-10-07 14:19:27 +01:00
|
|
|
pieholeIp = configVars.networking.addresses.piehole.ip;
|
|
|
|
gatewayIp = configVars.networking.addresses.gateway.ip;
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
# Create users for this host
|
|
|
|
../common/users/media
|
2024-05-23 00:10:58 +01:00
|
|
|
|
2024-10-07 14:19:27 +01:00
|
|
|
# Disk configuration
|
|
|
|
inputs.disko.nixosModules.disko
|
|
|
|
(import ../common/disks {
|
|
|
|
device = dev;
|
|
|
|
impermanence = impermanence;
|
|
|
|
fsType = fsType;
|
|
|
|
encrypted = encrypted;
|
|
|
|
})
|
2024-05-27 16:19:00 +01:00
|
|
|
|
2024-10-07 14:19:27 +01:00
|
|
|
# Impermanence
|
|
|
|
(import ../common/disks/btrfs/impermanence.nix {
|
|
|
|
btrfsMountDevice = btrfsMountDevice;
|
|
|
|
lib = lib;
|
|
|
|
})
|
2024-05-27 16:19:00 +01:00
|
|
|
|
2024-10-07 14:19:27 +01:00
|
|
|
# Import core options
|
|
|
|
./hardware-configuration.nix
|
|
|
|
../common/core
|
2024-05-16 11:55:24 +01:00
|
|
|
|
2024-10-07 14:19:27 +01:00
|
|
|
# Import optional options
|
|
|
|
../common/optional/openssh.nix
|
|
|
|
../common/optional/persistence.nix
|
|
|
|
../common/optional/nfs-mounts/media.nix
|
|
|
|
../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-10-07 14:19:27 +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-10-07 14:19:27 +01:00
|
|
|
nameservers = ["${pieholeIp}" "${gatewayIp}" "8.8.8.8"];
|
2024-05-16 20:19:01 +01:00
|
|
|
};
|
|
|
|
|
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-10-07 14:19:27 +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
|
|
|
}
|