dotfiles/hosts/Aloria/hardware-configuration.nix

101 lines
3.3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel" "v4l2loopback" "intel_vsc" "intel_vsc_csi" "intel_vsc_vbus"];
boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback tp_smapi ipu6-drivers];
boot.extraModprobeConfig = ''
options thinkpad_acpi fan_control=1
options v4l2loopback exclusive_caps=1 card_label="Android Virtual Camera"
options v4l2loopback exclusive_caps=1 video_nr=42 card_label="IPU6 Virtual Camera"
'';
# boot.kernelParams = ["ipv6.disable=1"];
fileSystems."/" = {
device = "rpool/root";
fsType = "zfs";
};
fileSystems."/home" = {
device = "rpool/home";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5C58-A909";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.trackpoint.enable = lib.mkDefault true;
hardware.trackpoint.emulateWheel = lib.mkDefault config.hardware.trackpoint.enable;
hardware.trackpoint.device = "TPPS/2 Synaptics TrackPoint";
nixpkgs.config.packageOverrides = pkgs: {
zfs = pkgs.zfs_unstable;
};
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.firmware = with pkgs; [
ipu6-camera-bins
ivsc-firmware
];
services.udev.extraRules = ''
SUBSYSTEM=="intel-ipu6-psys", MODE="0660", GROUP="video"
'';
systemd.services.ipu6-v4l2-proxy = {
description = "IPU6 Libcamera to V4L2Loopback Proxy";
# wantedBy = ["multi-user.target"];
after = ["systemd-udev-settle.service"];
serviceConfig = {
ExecStart = let
gstPluginPath = pkgs.lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with pkgs.gst_all_1;
[
gstreamer
gst-plugins-base
gst-plugins-good
gst-plugins-bad
]
++ [pkgs.libcamera]);
in ''
${pkgs.gst_all_1.gstreamer}/bin/gst-launch-1.0 \
--gst-plugin-path=${gstPluginPath} \
libcamerasrc \
! video/x-raw \
! vapostproc contrast=1.3 saturation=1.4 brightness=-0.15 \
! video/x-raw,width=1280,height=720 \
! videoconvert \
! gamma gamma=0.7 \
! videoconvert \
! video/x-raw,format=YUY2 \
! v4l2sink device=/dev/video42
'';
Restart = "always";
RestartSec = "3";
};
};
}