How to DisableCapsuleUpdateOnDisk in /etc/fwupd/uefi_capsule.conf

I am trying use fwupdmgr to update the system firmware on my Framework laptop. The manufacturer says I must do the following:

Please set DisableCapsuleUpdateOnDisk=true in /etc/fwupd/uefi_capsule.conf before applying this update, otherwise the update will fail.

How do I achieve this in NixOS?

I would try the following:

environment.etc."fwupd/uefi_capsule.conf".text = ''

Yeah, I already tried that:

error: The option `environment.etc."fwupd/uefi_capsule.conf".source' has conflicting definition values:
       - In `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/etc/etc.nix': <derivation /nix/store/6n9yfmnww3lyd70d46yl6yqsf80315kd-etc-uefi_capsule.conf.drv>
       - In `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/services/hardware/fwupd.nix': <derivation /nix/store/53d6k5484080jz9zra4f0zh2rhbj4nsl-uefi_capsule.conf.drv>

I also tried this:

  environment.etc."fwupd/uefi_capsule.conf".text = pkgs.lib.mkDefault( pkgs.lib.mkAfter ''

and although I didn’t get any errors when I ran sudo nixos-rebuild switch, the file /etc/fwupd/uefi_capsule.conf was not modified.

Just ran into this myself. Longer term I think fwupd’s nixos module needs to adjust to be RFC42 compliant (rfcs/ at 553b132ca05e0ad19b563b80b08d17330df205cf · NixOS/rfcs · GitHub) so these configs can be tweaked more easily. But in the meantime, what I did was put an override in my config that includes the default from the module source code, plus my change:

environment.etc."fwupd/uefi_capsule.conf" = lib.mkForce {
  source = pkgs.writeText "uefi_capsule.conf" ''

This worked for me, I just updated my Framework’s firmware through a couple versions with no issues.

Sent nixos/fwupd: allow customization of uefi_capsule.conf. by danderson · Pull Request #208326 · NixOS/nixpkgs · GitHub to make this more easily configurable in NixOS. Then we can send a PR to nixos-hardware/framework at master · NixOS/nixos-hardware · GitHub to get things configured correctly out of the box.

1 Like
Hosted by Flying Circus.