0

我想为我的新笔记本电脑创建一个启用了一些自定义固件的可启动 USB,但是我似乎无法掌握如何设置它...

我基本上遵循这里的指南:https : //nix.dev/tutorials/building-bootable-iso-image 我想我想启用“rtw89-firmware”并将其与来自 nixos-hardware repo 的定义结合起来:https ://github.com/NixOS/nixos-hardware/blob/0a8b8054c9920368a3c15e6d766188fdf04b736f/lenovo/thinkpad/p14s/amd/gen2/default.nix

我目前的尝试:

{ pkgs, modulesPath, lib, config, ... }: {
  imports = [
    "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
  ];

  # use the latest Linux kernel
  boot = {
    kernelModules = [ "acpi_call" ];
    extraModulePackages = with config.boot.kernelPackages; [ acpi_call rtw89 ];
    kernelPackages = pkgs.linuxPackages_latest;
  };

  # Needed for https://github.com/NixOS/nixpkgs/issues/58959
  #boot.supportedFilesystems = lib.mkForce [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];

  # For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI.

  # amdgpu.backlight=0 makes the backlight work
  # acpi_backlight=none allows the backlight save/load systemd service to work.
  boot.kernelParams = ["amdgpu.backlight=0" "acpi_backlight=none"];

  # Wifi support
  hardware.enableRedistributableFirmware = true;
}

我正在尝试使用以下方法构建 ISO 映像:

nix-shell -p nixos-generators -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/b5182c214fac1e6db9f28ed8a7cfc2d0c255c763.tar.gz --run "nixos-generate --format iso --configuration ./nixos-bootable-img.nix -o result"

但这失败了

错误:/home/user/tmp/nixos-bootable-img.nix:9:72 处的未定义变量“rtw89”

谁能在这里指出我正确的方向?从我的角度来看(这显然是错误的),我希望固件存在于 pkgs 中。

谢谢!

4

0 回答 0