nix/hosts/nixos-laptop/configuration.nix
2023-07-12 15:08:57 +09:00

55 lines
1.4 KiB
Nix

{ lib, config, pkgs, ... }: {
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Set the networking hostname:
networking.hostName = "nixos-laptop";
# 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 and OpenGL
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
hardware = {
nvidia.modesetting.enable = true;
opengl.enable = true;
opengl.driSupport32Bit = true;
nvidia.powerManagement.enable = true;
nvidia.prime = {
# sync.enable = true;
offload.enable = true;
offload.enableOffloadCmd = true;
intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
};
environment.systemPackages = with pkgs; [
# Fingerprint software
fprintd
];
imports = [
# Modules
../../modules/powertop.nix
];