nix/hosts/nixos-laptop/configuration.nix

56 lines
1.5 KiB
Nix
Raw Normal View History

2023-07-01 10:23:32 +02:00
{ lib, config, pkgs, ... }: {
2023-07-06 05:24:21 +02:00
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
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;
};
2023-07-05 14:58:58 +02:00
# Enable nVidia PRIME Render Offload and OpenGL
2023-07-01 10:23:32 +02:00
# https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/p1/3th-gen/nvidia.nix
2023-07-05 14:58:58 +02:00
hardware = {
2023-07-11 13:34:33 +02:00
nvidia.modesetting.enable = true;
2023-07-05 14:58:58 +02:00
opengl.enable = true;
opengl.driSupport32Bit = true;
2023-07-12 05:09:52 +02:00
nvidia.powerManagement.enable = true;
2023-07-05 14:58:58 +02:00
nvidia.prime = {
2023-07-12 05:54:40 +02:00
sync.enable = true;
2023-07-12 05:09:52 +02:00
offload.enable = true;
2023-07-12 05:54:40 +02:00
offload.enableOffloadCmd = true;
2023-07-05 14:58:58 +02:00
intelBusId = lib.mkDefault "PCI:0:2:0";
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};
2023-07-01 10:23:32 +02:00
};
# Fingerprint software
2023-07-12 05:54:40 +02:00
environment.systemPackages = with pkgs; [
fprintd
nvtop-nvidia
];
2023-07-05 03:44:53 +02:00
imports = [
# Modules
../../modules/powertop.nix
];
2023-07-01 10:23:32 +02:00
}