Skip to content

Instantly share code, notes, and snippets.

@p-alik
Last active January 13, 2025 15:31
Show Gist options
  • Save p-alik/6ed132ffad59de8fcbc4fb10b54d745e to your computer and use it in GitHub Desktop.
Save p-alik/6ed132ffad59de8fcbc4fb10b54d745e to your computer and use it in GitHub Desktop.
NixOS config on Dell XPS 13 Plus 9320
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "ls03064"; # Define your hostname.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# https://nixos.org/manual/nixos/stable/index.html#sec-x11--graphics-cards-intel
services.xserver.videoDrivers = [ "intel" ];
services.xserver.deviceSection = ''
Option "DRI" "2"
Option "TearFree" "true"
'';
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "de";
xkbVariant = "";
};
console.keyMap = "de";
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# for sake of ipu6-camera-bins
nixpkgs.config.allowUnfree = true;
users.users.<USER> = {
isNormalUser = true;
description = "..";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
home-manager
# leave browsers here for sake of camera support
firefox
google-chrome
];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
file
glxinfo
htop
inxi
lshw
openvpn
pciutils
# https://discourse.nixos.org/t/v4l2loopback-cannot-find-module/26301/5
# obs-studio
v4l-utils
vim
];
programs.vim.defaultEditor = true;
system.stateVersion = "23.11";
}
# /etc/nixos/hardware-configuration.nix
{ config, lib, pkgs, modulesPath, ... }:
let
ivsc-firmware = with pkgs;
stdenv.mkDerivation rec {
pname = "ivsc-firmware";
version = "main";
src = pkgs.fetchFromGitHub {
owner = "intel";
repo = "ivsc-firmware";
rev = "10c214fea5560060d387fbd2fb8a1af329cb6232";
sha256 = "sha256-kEoA0yeGXuuB+jlMIhNm+SBljH+Ru7zt3PzGb+EPBPw=";
};
installPhase = ''
mkdir -p $out/lib/firmware/vsc/soc_a1_prod
cp firmware/ivsc_pkg_ovti01a0_0.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_pkg_ovti01a0_0_a1_prod.bin
cp firmware/ivsc_skucfg_ovti01a0_0_1.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_skucfg_ovti01a0_0_1_a1_prod.bin
cp firmware/ivsc_fw.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_fw_a1_prod.bin
'';
};
in
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" "i915" ];
boot.initrd.kernelModules = [];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [];
# https://discourse.nixos.org/t/i915-driver-has-bug-for-iris-xe-graphics/25006/10
# resolved: i915 0000:00:02.0: [drm] Selective fetch area calculation failed in pipe A
boot.kernelParams = [
"i915.enable_psr=0"
];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/5cfd71ea-6978-427b-9b10-75249bcc63ff";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-5f6a700d-cfdb-492c-b52d-d875e818631c".device = "/dev/disk/by-uuid/5f6a700d-cfdb-492c-b52d-d875e818631c";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/F642-A1B7";
fsType = "vfat";
};
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.enp0s13f0u1u4.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Tracking Issue: Intel MIPI/IPU6 webcam-support
# https://github.com/NixOS/nixpkgs/issues/225743#issuecomment-1849613797
# Infrastructure Processing Unit
hardware.ipu6 = {
enable = true;
platform = "ipu6ep";
};
hardware.enableRedistributableFirmware = true;
hardware.firmware = [
ivsc-firmware
];
# environment.etc.camera.source = "${ipu6-camera-hal}/share/defaults/etc/camera";
}
@tobiasBora
Copy link

Awesome, it works great to have webcam! Just, it fails in cheese, but all other programs I tried get it right:

  1. firefox
  2. chrome
  3. obs
  4. zoom-us

Thank you so much. Note that to get sound right, I needed to run alsactl init.

@p-alik
Copy link
Author

p-alik commented Mar 8, 2024

might be cheese has a permissions issue as mentioned here

sudo cheese 

(cheese:543473): cheese-WARNING **: 09:26:02.442: Device '/dev/video1' does not support 2:0:0:0 colorimetry: ../sys/v4l2/gstv4l2object.c(4213): gst_v4l2_object_set_format_full (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin36/GstV4l2Src:v4l2src1:
Device wants 2:0:0:0 colorimetry

Without sudo see notgne2/xps_9320.nix

@pm-McFly
Copy link

Note for 24.11:

error: Package ‘ipu6-drivers-unstable-2024-10-10’ in /nix/store/0xbni69flk8380w0apw4h640n37wn1i9-source/pkgs/os-specific/linux/ipu6-drivers/default.nix:49 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.

When enabled:

sudo nixos-rebuild switch
building the system configuration...
error: builder for '/nix/store/xw5ywnyc4gc8q6wpmc4nmbbiy8rhkc76-ipu6-drivers-unstable-2024-10-10.drv' failed with exit code 2;
       last 25 log lines:
       > /build/source/drivers/media/pci/intel/ipu6/../ipu-buttress.c:24:10: fatal error: ipu-platform-buttress-regs.h: No such file or directory
       >    24 | #include "ipu-platform-buttress-regs.h"
       >       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > make[4]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/scripts/Makefile.build:243: /build/source/drivers/media/pci/intel/ipu6/../ipu-buttress.o] Error 1
       > In file included from /build/source/drivers/media/pci/intel/ipu6/../ipu-isys.h:17,
       >                  from /build/source/drivers/media/pci/intel/ipu6/../ipu-isys.c:37:
       > /build/source/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.h:13:10: fatal error: ipu-platform-isys.h: No such file or directory
       >    13 | #include "ipu-platform-isys.h"
       >       |          ^~~~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > make[4]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/scripts/Makefile.build:243: /build/source/drivers/media/pci/intel/ipu6/../ipu-isys.o] Error 1
       > In file included from /build/source/drivers/media/pci/intel/ipu6/../ipu-isys.h:17,
       >                  from /build/source/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.c:16:
       > /build/source/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.h:13:10: fatal error: ipu-platform-isys.h: No such file or directory
       >    13 | #include "ipu-platform-isys.h"
       >       |          ^~~~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > make[4]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/scripts/Makefile.build:243: /build/source/drivers/media/pci/intel/ipu6/../ipu-isys-csi2.o] Error 1
       > make[3]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/scripts/Makefile.build:480: /build/source/drivers/media/pci/intel/ipu6] Error 2
       > make[3]: *** Waiting for unfinished jobs....
       > make[2]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/Makefile:1921: /build/source] Error 2
       > make[1]: *** [/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/source/Makefile:234: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/2acbdwpzlwghygaiikwzy8gvz9klffy4-linux-6.6.64-dev/lib/modules/6.6.64/build'
       > make: *** [Makefile:126: all] Error 2
       For full logs, run 'nix log /nix/store/xw5ywnyc4gc8q6wpmc4nmbbiy8rhkc76-ipu6-drivers-unstable-2024-10-10.drv'.
error: 1 dependencies of derivation '/nix/store/r0j63b2g54rwkvg42zfq2ir8x2v0f97f-linux-6.6.64-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/y54ljnxahk2kqyj6y91h667l754b7bwk-nixos-system-nixos-24.11.20241213.314e12b.drv' failed to build

@p-alik
Copy link
Author

p-alik commented Dec 19, 2024

@pm-McFly, I've faced the same issue with kernel 6.6.43. :-(

@p-alik
Copy link
Author

p-alik commented Dec 19, 2024

@pm-McFly
Copy link

I tried using the derivations found on the other gist:

see notgne2/xps_9320.nix

And tried to modified them to maybe find a revision that works, but was ultimately blocked due to inconsistent revision expectations...

@AdrienLemaire
Copy link

AdrienLemaire commented Dec 27, 2024

Looks like it's been fixed in NixOS/nixpkgs#368326
But I'm having a new error

$ sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
$ sudo nixos-rebuild switch --upgrade
...

       error: xf86videointel has been removed as the package is unmaintained and the driver is no longer functional.
       Please remove "intel" from `services.xserver.videoDrivers` and switch to the "modesetting" driver.

after setting modesetting and trying again, I get

$ sudo nixos-rebuild switch --upgrade
...
       error: Package ‘ipu6-drivers-unstable-2024-11-19’ in /nix/store/bfr3xwnd4qam39i69czczlxjn1pmv340-nixos/nixos/pkgs/os-specific/linux/ipu6-drivers/default.nix:51 is marked as broken, refusing to evaluate.

Since I have literally discovered NixOS only a couple hours ago, I suppose I did something wrong 🤣

@p-alik
Copy link
Author

p-alik commented Dec 27, 2024

Looks like it's been fixed in NixOS/nixpkgs#368326 But I'm having a new error

The pull request is just back porting to 24.11. However the driver didn't work in my case. See the message on discourse

@AdrienLemaire
Copy link

Hi guys. Over the past 2 weeks, I have been studying nixos, improving my setup, and now revisiting this camera issue.

I am at a point where a camera is detected, but not functional.
image

~ on ☁️    nix-store -qR /run/current-system | grep -E '/nix/store' | grep ipu6
/nix/store/0vmw3dqi6n82g8wlv3cd4859h29yzml3-unit-script-v4l2-relayd-ipu6-pre-start
/nix/store/2d0891x33yp6ws6r501f837jpx7isp93-ipu6-camera-bins-unstable-2024-09-27
/nix/store/5bw0a695j4y1akiyci5smnklnrd14spq-ipu6-drivers-unstable-2024-10-10
/nix/store/5c215vaxyxjadk7i4n3z7yp6b7m61qid-ipu6-drivers-unstable-2024-11-19
/nix/store/c8q6fv771g0kiga44001bbxr2475limx-unit-script-v4l2-relayd-ipu6-post-stop
/nix/store/ig6zzkj58kmff23rw9k0ack355n3jna3-unit-script-v4l2-relayd-ipu6-start
/nix/store/zlp4703kxcaxn0r7zw5d630zpyjxw668-ipu6ep-camera-hal-unstable-2024-09-29
/nix/store/sgsk8w55vifydya58vd7kixq9wjv0jni-icamerasrc-ipu6ep-unstable-2024-09-29
/nix/store/agpz2zy2v5kb719qxp6lmpj9gzdk4csn-unit-v4l2-relayd-ipu6.service
/nix/store/mganw0r30y2084vrpiiisbdlzmij6164-ipu6-camera-bins-unstable-2024-09-27-zstd

~ on ☁️    sudo dmesg | grep ipu6 | lines | last 15
╭────┬─────────────────────────────────────────────────────────────────────────────────────╮
  0  [    5.611228] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff 
  1  [    5.612330] intel-ipu6 0000:00:05.0: FW version: 20230925                        
  2  [   13.575797] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff 
  3  [   13.580376] intel-ipu6 0000:00:05.0: FW version: 20230925                        
  4  [   13.585838] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff 
  5  [   13.587286] intel-ipu6 0000:00:05.0: FW version: 20230925                        
  6  [   13.623646] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff 
  7  [   13.624922] intel-ipu6 0000:00:05.0: FW version: 20230925                        
  8  [   13.649968] intel-ipu6 0000:00:05.0: IPU6 in non-secure mode touch 0x0 mask 0xff 
  9  [   13.651119] intel-ipu6 0000:00:05.0: FW version: 20230925                        
 10  [   13.651856] intel-ipu6 0000:00:05.0: Found supported sensor OVTI01A0:00          
 11  [   13.651947] intel-ipu6 0000:00:05.0: Connected 1 cameras                         
 12  [   13.652923] intel-ipu6 0000:00:05.0: IPU6-v3[a75d] hardware version 5            
 13  [   13.774201] intel_ipu6_psys.psys intel_ipu6.psys.40: pkg_dir entry count:8       
 14  [   13.774252] intel_ipu6_psys.psys intel_ipu6.psys.40: psys probe minor: 0         
╰────┴─────────────────────────────────────────────────────────────────────────────────────╯

My files (using hydenix):

hardware-configuration.nix{ config, lib, pkgs, modulesPath, ... }: let ivsc-firmware = with pkgs; stdenv.mkDerivation rec { pname = "ivsc-firmware"; version = "main"; src = pkgs.fetchFromGitHub { owner = "intel"; repo = "ivsc-firmware"; rev = "10c214fea5560060d387fbd2fb8a1af329cb6232"; sha256 = "sha256-kEoA0yeGXuuB+jlMIhNm+SBljH+Ru7zt3PzGb+EPBPw="; }; installPhase = '' mkdir -p $out/lib/firmware/vsc/soc_a1_prod cp firmware/ivsc_pkg_ovti01a0_0.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_pkg_ovti01a0_0_a1_prod.bin cp firmware/ivsc_skucfg_ovti01a0_0_1.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_skucfg_ovti01a0_0_1_a1_prod.bin cp firmware/ivsc_fw.bin $out/lib/firmware/vsc/soc_a1_prod/ivsc_fw_a1_prod.bin ''; }; in { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "usbhid" "sd_mod" "i915" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.configurationLimit = 15; # https://discourse.nixos.org/t/i915-driver-has-bug-for-iris-xe-graphics/25006/10 # resolved: i915 0000:00:02.0: [drm] Selective fetch area calculation failed in pipe A boot.kernelParams = [ "i915.enable_psr=0" ]; fileSystems."/" = #{ device = "/dev/disk/by-uuid/bf7761a1-df16-45b2-bbe9-737a15da6819"; { device = "/dev/disk/by-label/NIXROOT"; fsType = "ext4"; }; fileSystems."/boot" = #{ device = "/dev/disk/by-uuid/46F1-6F0A"; { device = "/dev/disk/by-label/ESP"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; 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; # Tracking Issue: Intel MIPI/IPU6 webcam-support # https://github.com/NixOS/nixpkgs/issues/225743#issuecomment-1849613797 # Infrastructure Processing Unit hardware.ipu6 = { enable = true; platform = "ipu6ep"; }; hardware.firmware = [ ivsc-firmware #(pkgs.ivsc-firmware.overrideAttrs (attrs: { # postInstall = # (attrs.postInstall or "") # + '' # mkdir -p $out/lib/firmware/vsc/soc_a1_prod # for file in $out/lib/firmware/vsc/*.bin; do # ln -sf "$file" "$out/lib/firmware/vsc/soc_a1_prod/$(basename "$file" .bin)_a1_prod.bin" # done # ''; #})) ]; hardware.enableRedistributableFirmware = true; hardware.pulseaudio.enable = lib.mkForce false; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; jack.enable = true; }; services.pipewire.wireplumber.configPackages = [ (pkgs.writeTextDir "share/wireplumber/bluetooth.lua.d/51-bluez-config.lua" '' bluez_monitor.properties = { ["bluez5.enable-sbc-xq"] = true, ["bluez5.enable-msbc"] = true, ["bluez5.enable-hw-volume"] = true, ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" } '') ]; services.fwupd.enable = lib.mkDefault true; }
nix-modules.nix
{ inputs, userPkgs, ... }:
{
  environment.systemPackages = with userPkgs; [ 
    # customLibxkbcommon
    plocate
    google-chrome
    ripgrep.out
    qwerty-fr
    # Hyde run screencap
    linuxKernel.packages.linux_zen.ipu6-drivers
    wf-recorder
    grim
    inputs.ghostty.packages.x86_64-linux.default
    zoxide
    nushell
    volta
    carapace
    glances
    wget
    mplayer
    starship
    # https://discourse.nixos.org/t/v4l2loopback-cannot-find-module/26301/5
    #obs-studio
    v4l-utils
    dolphin
    vimPlugins.LazyVim
    gcc  
    fd
    lazygit
    tree-sitter
    cargo
    lynx
    unzip
    # Sound eXchange for gp.nvim
    sox
    sof-firmware
    #alsa-utils
    # AI tools nushell
    ffmpeg
    openai-whisper
    yt-dlp
    gcalcli
    pinentry-rofi
    # pueue for task.nu
    pueue
  ];

  fonts = {
    enableDefaultPackages = true;
    packages = with userPkgs; [
      # https://nixos.wiki/wiki/Fonts
      #nerd-fonts.fira-code
      #nerd-fonts.droid-sans-mono
      noto-fonts
      noto-fonts-cjk-sans
      noto-fonts-emoji
      liberation_ttf
      mplus-outline-fonts.githubRelease
      dina-font
      proggyfonts
      carlito
      dejavu_fonts
      ipafont
      kochi-substitute
      source-code-pro
      ttf_bitstream_vera
    ];
    fontconfig.defaultFonts = {
      monospace = [
        "DejaVu Sans Mono"
        "IPAGothic"
      ];
      sansSerif = [
        "DejaVu Sans"
        "IPAPGothic"
      ];
      serif = [
        "DejaVu Serif"
        "IPAPMincho"
      ];
    };
  };

  i18n.inputMethod = {
    type = "fcitx5";
    enable = true;
    fcitx5.addons = with userPkgs; [
      fcitx5-mozc
      # fcitx5-gtk
      catppuccin-fcitx5
    ];
  };

  # Necessary to use volta-installed node
  # used by copilot
  programs.nix-ld.enable = true;

   # GnuPG
  programs.gnupg.agent = {
    enable = true;
    enableSSHSupport = true;
  };
  services.pcscd.enable = true;

  services.locate = {
    enable = true;
    package = userPkgs.plocate;
    localuser = null;
  };
  services.ollama.enable = true;

  services.xserver.videoDrivers = [ "intel" ];
  services.xserver.deviceSection = ''
      Option "DRI" "2"
      Option "TearFree" "true"
    '';
  services.xserver.xkb.extraLayouts."qwerty-fr" = {
    languages = ["eng" "fra"];
    symbolsFile = "${userPkgs.qwerty-fr}/share/X11/xkb/symbols/us_qwerty-fr";
    description = "make qwerty-fr accessible as a layout in nixos";
  };

  users.users.dori.homeMode = "701";
}
config.nix
{
  username = "dori";
  gitUser = "AdrienLemaire";
  host = "xps13-9320";
  defaultPassword = "hydenix";
  timezone = "Europe/Paris";
  locale = "en_US.UTF-8";

  # hardware config - sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix
  hardwareConfig = (toString ./hardware-configuration.nix);

  # List of drivers to install in ./hosts/nixos/drivers.nix
  drivers = [
    "amdgpu"
    "intel"
  ];

  # List of nix modules to import in ./hosts/nixos/default.nix
  nixpkgs.config.allowUnfree = true;
  nixModules = [
    (toString ./nix-modules.nix)
  ];
  # List of nix modules to import in ./lib/mkConfig.nix
  homeModules = [
    (toString ./home-modules.nix)
  ];

  # Enable CUPS to print documents.
  services.printing.enable = true;

  hyde = rec {
    sddmTheme = "Corners";
    enable = true;

    # active theme, must be in themes list
    activeTheme = "Catppuccin Mocha";

    # list of themes to choose from
    themes = [
      # -- Default themes
      "Catppuccin Mocha"
      "Catppuccin Latte"
      "Material Sakura"
      "Rose Pine"
      "Tokyo Night"
    ];
  };
}

Some thoughts:

  • this PR on nixos-hardware has been abandonned and could be reopened by someone capable
  • we could add another PR to nixos/pkgs to upgrade ivsc-firmware to the latest version and remove the let ... in from our hardwware-configuration.nix

@p-alik am I correct in thinking that nobody running nixos 24.11 or unstable has camera working at the moment ?
When digging through related github issues/PR from your discourse link, it seems like everything got resolved and merged, and that I'm probably the only one who can't manage to get his webcam working 😅

@p-alik
Copy link
Author

p-alik commented Jan 13, 2025

@AdrienLemaire, here the current state for my Dell XPS 13 Plus 9320

$ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.43, NixOS, 24.05 (Uakari), 24.05.7376.b134951a4c9f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - channels(root): `"nixos-24.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

$ uname -r
6.6.43
       error: xf86videointel has been removed as the package is unmaintained and the driver is no longer functional.
       Please remove "intel" from `services.xserver.videoDrivers` and switch to the "modesetting" driver.

@p-alik
Copy link
Author

p-alik commented Jan 13, 2025

No success on 24.11 with services.xserver.videoDrivers = [ "modesetting" ]; suggested in Intel Graphics drivers {#sec-x11--graphics-cards-intel}

$ nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.12.9, NixOS, 24.11 (Vicuna), 24.11.713063.635e887b4852`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.11`
 - channels(root): `"nixos-24.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

$ uname -r
6.12.9
[   23.956291] ------------[ cut here ]------------
[   23.956294] WARNING: CPU: 11 PID: 736 at kernel/dma/mapping.c:597 dma_alloc_attrs+0x14e/0x160
[   23.956302] Modules linked in: snd_soc_rt1316_sdw(+) regmap_sdw_mbq regmap_sdw snd_soc_dmic intel_ipu6_psys(O+) snd_sof_pci_intel_tgl snd_sof_pci_intel_cnl snd_sof_intel_hda_generic soundwire_intel soundwire_cadence snd_sof_intel_hda_common xt_conntrack snd_soc_hdac_hda snd_sof_intel_hda_mlink snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp iwlmvm(+) ip6t_rpfilter snd_sof ipt_rpfilter intel_ipu6_isys snd_sof_utils snd_soc_acpi_intel_match hid_sensor_als hid_sensor_custom_intel_hinge videobuf2_dma_sg hid_sensor_trigger soundwire_generic_allocation snd_soc_acpi industrialio_triggered_buffer videobuf2_memops xt_pkttype soundwire_bus kfifo_buf videobuf2_v4l2 hid_sensor_iio_common xt_LOG nf_log_syslog snd_soc_avs videobuf2_common industrialio ivsc_csi(+) xt_tcpudp ivsc_ace(+) mac80211 nft_compat hid_sensor_custom snd_soc_hda_codec snd_hda_ext_core hid_sensor_hub intel_uncore_frequency snd_soc_core intel_uncore_frequency_common x86_pkg_temp_thermal intel_powerclamp nls_iso8859_1 snd_compress nls_cp437 coretemp ac97_bus ptp
[   23.956334]  crct10dif_pclmul snd_pcm_dmaengine crc32_pclmul spi_pxa2xx_platform pps_core vfat intel_ishtp_hid joydev dw_dmac polyval_clmulni typec_displayport hid_multitouch fat xe libarc4 nf_tables sch_fq_codel dw_dmac_core polyval_generic mei_vsc spi_pxa2xx_core 8250_dw snd_hda_intel snd_usb_audio ghash_clmulni_intel btusb iwlwifi snd_intel_dspcfg cmdlinepart r8153_ecm snd_intel_sdw_acpi btrtl snd_usbmidi_lib processor_thermal_device_pci rapl cdc_ether btintel snd_hda_codec snd_ump spi_nor mei_hdcp processor_thermal_device iTCO_wdt btbcm mei_pxp processor_thermal_wt_hint usbnet snd_rawmidi intel_pmc_bxt drm_gpuvm dell_pc processor_thermal_rfim tpm_crb ucsi_acpi btmtk platform_profile intel_cstate drm_exec intel_rapl_msr watchdog mtd spi_ljca i2c_ljca gpio_ljca dell_laptop v4l2loopback(O) snd_hda_core typec_ucsi gpu_sched dell_wmi cfg80211 snd_seq_device processor_thermal_rapl bluetooth intel_uncore dell_wmi_ddv dell_smm_hwmon snd_ctl_led dell_wmi_sysman firmware_attributes_class psmouse ov01a10(O) snd_hwdep
[   23.956373]  intel_rapl_common loop intel_ish_ipc intel_ipu6 mei_me igen6_edac processor_thermal_wt_req snd_pcm r8152 tpm_tis drm_suballoc_helper typec intel_ishtp i2c_i801 dell_smbios spi_intel_pci processor_thermal_power_floor cpufreq_powersave intel_lpss_pci dcdbas mii intel_lpss libphy dell_wmi_descriptor wmi_bmof snd_timer tiny_power_button spi_intel hid_jabra mousedev snd v4l2_fwnode i2c_mux xt_nat mei idma64 usb_ljca rfkill 8250_pci drm_ttm_helper ipu_bridge edac_core tpm_tis_core processor_thermal_mbox roles button battery soundcore virt_dma i2c_smbus v4l2_async nf_nat intel_skl_int3472_tps68470 mei_vsc_hw tps68470_regulator int3403_thermal i2c_hid_acpi videodev nf_conntrack clk_tps68470 int340x_thermal_zone i2c_hid intel_pmc_core nf_defrag_ipv6 intel_vsec mc nf_defrag_ipv4 pmt_telemetry intel_skl_int3472_discrete libcrc32c int3400_thermal intel_hid pmt_class acpi_thermal_rel intel_skl_int3472_common pinctrl_tigerlake acpi_tad acpi_pad evdev sparse_keymap br_netfilter mac_hid ac veth tun serio_raw tap macvlan
[   23.956413]  bridge stp llc kvm_intel kvm fuse efi_pstore configfs nfnetlink efivarfs dmi_sysfs ip_tables x_tables autofs4 ext4 crc32c_generic crc16 mbcache jbd2 dm_crypt cbc encrypted_keys trusted asn1_encoder tee tpm rng_core libaescfb ecdh_generic ecc hid_generic usbhid hid i915 input_leds i2c_algo_bit led_class drm_buddy ttm atkbd intel_gtt libps2 nvme xhci_pci crc32c_intel vivaldi_fmap drm_display_helper thunderbolt sha512_ssse3 xhci_hcd sha256_ssse3 nvme_core sha1_ssse3 aesni_intel video gf128mul crypto_simd cryptd cec nvme_auth i8042 wmi rtc_cmos serio backlight dm_mod dax
[   23.956444] CPU: 11 UID: 0 PID: 736 Comm: (udev-worker) Tainted: G     U     O       6.12.9 #1-NixOS
[   23.956447] Tainted: [U]=USER, [O]=OOT_MODULE
[   23.956448] Hardware name: Dell Inc. XPS 9320/0CW9KM, BIOS 2.14.0 07/09/2024
[   23.956450] RIP: 0010:dma_alloc_attrs+0x14e/0x160
[   23.956453] Code: ff ff 90 0f 0b 90 45 31 ff 5b 5d 4c 89 f8 41 5c 41 5d 41 5e 41 5f 31 d2 31 c9 31 f6 31 ff 45 31 c0 45 31 c9 c3 cc cc cc cc 90 <0f> 0b 90 e9 e9 fe ff ff 45 31 ff e9 1e ff ff ff 66 90 90 90 90 90
[   23.956455] RSP: 0018:ffffafcb40bb7be0 EFLAGS: 00010246
[   23.956457] RAX: 0000000000000000 RBX: ffffa37f8dc36000 RCX: 0000000000000cc0
[   23.956459] RDX: ffffa37f9392d018 RSI: 0000000000002000 RDI: ffffa37f8dc36000
[   23.956460] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[   23.956461] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000002000
[   23.956462] R13: ffffa37f9392d018 R14: 0000000000000000 R15: ffffa37fa2222028
[   23.956464] FS:  00007fb38e453840(0000) GS:ffffa386ef780000(0000) knlGS:0000000000000000
[   23.956466] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   23.956467] CR2: 000055b0ec66b190 CR3: 0000000103c58000 CR4: 0000000000f52ef0
[   23.956469] PKRU: 55555554
[   23.956470] Call Trace:
[   23.956472]  <TASK>
[   23.956474]  ? __warn+0x89/0x130
[   23.956478]  ? dma_alloc_attrs+0x14e/0x160
[   23.956481]  ? report_bug+0x172/0x1a0
[   23.956485]  ? handle_bug+0x61/0xb0
[   23.956488]  ? exc_invalid_op+0x17/0x80
[   23.956490]  ? asm_exc_invalid_op+0x1a/0x20
[   23.956495]  ? dma_alloc_attrs+0x14e/0x160
[   23.956509]  ipu6_psys_probe+0x321/0x640 [intel_ipu6_psys]
[   23.956520]  ? __pfx_ipu6_psys_probe+0x10/0x10 [intel_ipu6_psys]
[   23.956528]  auxiliary_bus_probe+0x3f/0xa0
[   23.956532]  really_probe+0xd3/0x3a0
[   23.956535]  ? __pfx___driver_attach+0x10/0x10
[   23.956537]  __driver_probe_device+0x78/0x160
[   23.956540]  driver_probe_device+0x1f/0xa0
[   23.956543]  __driver_attach+0xea/0x1e0
[   23.956546]  bus_for_each_dev+0x89/0xe0
[   23.956548]  bus_add_driver+0x14d/0x280
[   23.956550]  driver_register+0x5d/0x120
[   23.956553]  __auxiliary_driver_register+0x72/0xf0
[   23.956556]  ? __pfx_ipu6_psys_aux_driver_init+0x10/0x10 [intel_ipu6_psys]
[   23.956563]  do_one_initcall+0x58/0x330
[   23.956568]  do_init_module+0x90/0x280
[   23.956573]  __do_sys_init_module+0x18a/0x1c0
[   23.956576]  do_syscall_64+0xb7/0x210
[   23.956579]  entry_SYSCALL_64_after_hwframe+0x77/0x7f
[   23.956582] RIP: 0033:0x7fb38df1891e
[   23.956608] Code: 48 8b 0d f5 84 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c2 84 0d 00 f7 d8 64 89 01 48
[   23.956609] RSP: 002b:00007ffd755f77d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000af
[   23.956612] RAX: ffffffffffffffda RBX: 000055fe96c6caa0 RCX: 00007fb38df1891e
[   23.956613] RDX: 00007fb38de00304 RSI: 000000000026d908 RDI: 00007fb38c1a0010
[   23.956614] RBP: 00007fb38c1a0010 R08: 0000000000000000 R09: 0000000000000000
[   23.956615] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb38de00304
[   23.956616] R13: 0000000000020000 R14: 000055fe96c79dd0 R15: 0000000000000000
[   23.956619]  </TASK>
[   23.956620] ---[ end trace 0000000000000000 ]---

@p-alik
Copy link
Author

p-alik commented Jan 13, 2025

Opened an issue kernel intel_ipu6_psys bug

@AdrienLemaire
Copy link

thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment