2022-03-05 03:20:22 +00:00
|
|
|
|
# This is nil.
|
|
|
|
|
# Nil is my current personal machine. It is a AMD Thinkpad T14 G2 with the follow specs;
|
|
|
|
|
#
|
|
|
|
|
# Onboard Memory: 16 GB DDR4 3200MHz (Soldered) Note: This can support another stick of RAM.
|
|
|
|
|
# Wireless: Realtek 8852AE 802.11AX (2 x 2) & Bluetooth® 5.2
|
|
|
|
|
# Processor: AMD Ryzen™ 5 Pro 5650U Processor (2.30 GHz, up to 4.20 GHz Max Boost, 6 Cores, 12 Threads, 16 MB Cache)
|
|
|
|
|
# Graphic Card: Integrated AMD Radeon™ Graphics
|
|
|
|
|
# Battery: 3 Cell Li-Polymer 50Wh
|
|
|
|
|
# Camera: IR & 720p HD
|
|
|
|
|
# SSD: 128 GB PCIe SSD
|
|
|
|
|
# Keyboard: US English
|
|
|
|
|
# System Expansion Slots: Smart Card Reader
|
|
|
|
|
# TPM Setting: Enabled Discrete TPM2.0
|
|
|
|
|
# Display: 14.0" FHD (1920 x 1080) IPS, anti-glare, touchscreen with Privacy Guard, 500 nits
|
|
|
|
|
#
|
|
|
|
|
# Its formatted as follows
|
|
|
|
|
# NAME TYPE MOUNTPOINT
|
|
|
|
|
# nvme0n1 disk
|
|
|
|
|
# ├─nvme0n1p1 part /boot
|
|
|
|
|
# └─nvme0n1p2 part
|
|
|
|
|
# └─crypt crypt /dev/mapper/root
|
|
|
|
|
# └─partitions lvm
|
|
|
|
|
# ├─swap swap /dev/partitions/swap
|
|
|
|
|
# └─lvm_root lvm /dev/partitions/lvm_root
|
|
|
|
|
# └─rpool zpool
|
|
|
|
|
# ├─rpool/root zfs
|
|
|
|
|
# ├─rpool/root/nixos zfs /
|
|
|
|
|
# └─rpool/home zfs /home
|
2021-11-28 01:10:36 +00:00
|
|
|
|
{ config, lib, pkgs, modulesPath, ... }:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports = [
|
|
|
|
|
../modules/profiles/laptop.nix
|
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
|
];
|
|
|
|
|
|
2021-12-15 05:12:00 +00:00
|
|
|
|
this.systems.zfs.enable = true;
|
|
|
|
|
|
2022-03-05 03:21:58 +00:00
|
|
|
|
networking = {
|
|
|
|
|
# This is required for the zfs module as well. Must be unique. Run the following head -c4 /dev/urandom | od -A none -t x4
|
|
|
|
|
hostId = "a7a1c3f5";
|
|
|
|
|
hostName = "nil"; # Define your hostname.
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2022-03-05 03:21:58 +00:00
|
|
|
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
|
|
|
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
|
|
|
|
# replicates the default behaviour.
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
interfaces = {
|
|
|
|
|
enp2s0f0.useDHCP = true;
|
|
|
|
|
enp5s0.useDHCP = true;
|
|
|
|
|
wlp3s0.useDHCP = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2021-11-28 22:20:10 +00:00
|
|
|
|
hardware.firmware = [ pkgs.rtw89-firmware ];
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2022-03-05 03:21:58 +00:00
|
|
|
|
boot = {
|
|
|
|
|
initrd = {
|
|
|
|
|
availableKernelModules = [
|
|
|
|
|
"nvme"
|
|
|
|
|
"vfat"
|
|
|
|
|
"xhci_pci"
|
|
|
|
|
"usbhid"
|
|
|
|
|
"usb_storage"
|
|
|
|
|
"sd_mod"
|
|
|
|
|
"sdhci_pci"
|
|
|
|
|
"cryptd"
|
|
|
|
|
];
|
|
|
|
|
kernelModules = [ "dm-snapshot" ];
|
|
|
|
|
};
|
|
|
|
|
kernelModules = [ "kvm-amd" ];
|
|
|
|
|
extraModulePackages = [ config.boot.kernelPackages.rtw89 ];
|
|
|
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
|
};
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2021-11-28 22:20:10 +00:00
|
|
|
|
boot.initrd.luks.devices."crypt" = {
|
|
|
|
|
device = "/dev/disk/by-partlabel/crypt";
|
|
|
|
|
preLVM = true;
|
|
|
|
|
};
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2022-03-05 03:21:58 +00:00
|
|
|
|
fileSystems = {
|
|
|
|
|
"/" = {
|
|
|
|
|
device = "rpool/root/nixos";
|
|
|
|
|
fsType = "zfs";
|
|
|
|
|
};
|
|
|
|
|
"/home" = {
|
|
|
|
|
device = "rpool/home";
|
|
|
|
|
fsType = "zfs";
|
|
|
|
|
};
|
|
|
|
|
"/boot" = {
|
|
|
|
|
device = "/dev/disk/by-partlabel/boot";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
2021-11-28 22:20:10 +00:00
|
|
|
|
};
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
2021-11-28 22:20:10 +00:00
|
|
|
|
swapDevices = [{ device = "/dev/partitions/swap"; }];
|
2021-11-28 01:10:36 +00:00
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "21.05"; # Did you read the comment?
|
|
|
|
|
}
|