anchor.diff:        mkEtcFile = p: nameValuePair (mkName p) { source = p; };
       in listToAttrs (map mkEtcFile cfg.extraTrustedKeys);
   
  -  # We cannot include the file in $out and rely on filesInstalledToEtc
  -  # to install it because it would create a cyclic dependency between
  -  # the outputs. We also need to enable the remote,
  -  # which should not be done by default.
  -  testRemote = if cfg.enableTestRemote then {
  -    "fwupd/remotes.d/fwupd-tests.conf" = {
  -      source = pkgs.runCommand "fwupd-tests-enabled.conf" {} ''
  +  enableRemote = base: remote: {
  +    "fwupd/remotes.d/${remote}.conf" = {
  +      source = pkgs.runCommand "${remote}-enabled.conf" {} ''
           sed "s,^Enabled=false,Enabled=true," \
  -        "${cfg.package.installedTests}/etc/fwupd/remotes.d/fwupd-tests.conf" > "$out"
  +        "${base}/etc/fwupd/remotes.d/${remote}.conf" > "$out"
         '';
       };
  -  } else {};
  +  };
  +  remotes = (foldl'
  +    (configFiles: remote: configFiles // (enableRemote cfg.package remote))
  +    {}
  +    cfg.extraRemotes
  +  ) // (
  +    # We cannot include the file in $out and rely on filesInstalledToEtc
  +    # to install it because it would create a cyclic dependency between
  +    # the outputs. We also need to enable the remote,
  +    # which should not be done by default.
  +    mkIf cfg.enableTestRemote (enableRemote cfg.package.installedTests "fwupd-tests")
  +  );
  +
   in {
   
     ###### interface
  
positive.code:         '';
        };
  
        enableTestRemote = mkOption {
          type = types.bool;
          default = false;
  
negative.code:     environment.systemPackages = [ cfg.package ];
  
      # customEtc overrides some files from the package
      environment.etc = originalEtc // customEtc // extraTrustedKeys // remotes;
  
      services.dbus.packages = [ cfg.package ];
  
  