nix/hosts/nixos-laptop/configuration.nix

36 lines
1.1 KiB
Nix
Raw Normal View History

2023-07-01 10:23:32 +02:00
{ lib, config, pkgs, ... }: {
2023-07-01 11:37:30 +02:00
# Set the networking hostname:
2023-07-01 11:38:21 +02:00
networking.hostName = "nixos-laptop";
2023-07-01 11:37:30 +02:00
2023-07-01 10:23:32 +02:00
# Enable swap on luks
boot.initrd.luks.devices."luks-9704447e-6bd0-4a35-9c24-20cbab81c431".device = "/dev/disk/by-uuid/9704447e-6bd0-4a35-9c24-20cbab81c431";
boot.initrd.luks.devices."luks-9704447e-6bd0-4a35-9c24-20cbab81c431".keyFile = "/crypto_keyfile.bin";
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
# Hibernation resume device:
boot.resumeDevice = "/dev/disk/by-uuid/67600fc1-6d26-4d2f-b2d3-a99174654058";
# Configure the fingerprint reader
services.fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
};
# Enable nVidia PRIME Render Offload
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
hardware.nvidia.prime = {
# Bus ID of the Intel GPU.
intelBusId = lib.mkDefault "PCI:0:2:0";
# Bus ID of the NVIDIA GPU.
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
# Fingerprint software
environment.systemPackages = with pkgs; [ fprintd ];
}