More modulatiry

This commit is contained in:
iFargle 2023-07-01 17:23:32 +09:00
parent a48a455788
commit 99b4d41dda
4 changed files with 39 additions and 36 deletions

View file

@ -10,7 +10,7 @@
# Other things to consider:
# Telegraf
{ lib, config, pkgs, hostname, ... }: {
{ lib, config, pkgs, ... }: {
imports =
[
# Gnome configuration file.
@ -31,8 +31,6 @@
# Bootloader
boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.cleanOnBoot = true;
# Hibernation resume device:
boot.resumeDevice = "/dev/disk/by-uuid/67600fc1-6d26-4d2f-b2d3-a99174654058";
# Plymouth splash screen
boot.plymouth.enable = true;
boot.initrd.systemd.enable = true;
@ -43,15 +41,6 @@
boot.lanzaboote.enable = true;
boot.lanzaboote.pkiBundle = "/etc/secureboot";
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
# 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";
# Enable networking
networking = {
hostName = "${hostname}";
@ -84,13 +73,6 @@
LC_TIME = "en_US.UTF-8";
};
# Configure the fingerprint reader
services.fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
};
# Configure keymap in X11
services.xserver = {
enable = true;
@ -104,15 +86,6 @@
videoDrivers = [ "nvidia" ];
autorun = true;
};
# 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";
};
# Enable sound with pipewire.
sound.enable = true;
@ -151,9 +124,6 @@
# Secureboot
sbctl
# Fingerprint Reader
fprintd
# General packages
# https://github.com/gvolpe/dconf2nix
dconf2nix

View file

@ -52,15 +52,15 @@
nixosConfigurations = {
# Declare the configuration for my laptop
nixos-p1 = lib.nixosSystem {
inherit system hostname;
inherit system;
modules = [
# Hardware Configuration
./hardware/lenovo-p1.nix
./hardware/lenovo-p1/hardware-configuration.nix
./hardware/lenovo-p1/configuration.nix
# SecureBoot Configuration
lanzaboote.nixosModules.lanzaboote
# NixOS Configuration file
# Common NixOS Configuration file
./configuration.nix
# Tell home-manager to use both global and user packages:
@ -73,7 +73,7 @@
# Declare the configuration for my desktop
nixos-desktop = lib.nixosSystem {
inherit system hostname;
inherit system;
modules = [
# Hardware Configuration
./hardware/desktop.nix

View file

@ -0,0 +1,33 @@
{ lib, config, pkgs, ... }: {
# 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 ];
}