anchor.diff:    };
   
     config = mkIf cfg.enable {
  +    assertions = [
  +      (
  +        let
  +          defaults =
  +            catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles));
  +        in {
  +          assertion = cfg.profiles == {} || length defaults == 1;
  +          message =
  +            "Must have exactly one default Firefox profile but found "
  +            + toString (length defaults)
  +            + optionalString (length defaults > 1)
  +                (", namely " + concatStringsSep ", " defaults);
  +        }
  +      )
  +
  +      (
  +        let
  +          duplicates =
  +            filterAttrs (_: v: length v != 1)
  +            (zipAttrs
  +            (mapAttrsToList (n: v: { "${toString v.id}" = n; })
  +            (cfg.profiles)));
  +
  +          mkMsg = n: v: "  - ID ${n} is used by ${concatStringsSep ", " v}";
  +        in {
  +          assertion = duplicates == {};
  +          message =
  +            "Must not have Firefox profiles with duplicate IDs but\n"
  +            + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates);
  +        }
  +      )
  +    ];
  +
       home.packages =
         let
           # A bit of hackery to force a config into the wrapper.
  
positive.code:         '';
        };
  
        enableAdobeFlash = mkOption {
          type = types.bool;
          default = false;
  
negative.code:   cfg = config.programs.firefox;
  
    extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
  
    profiles =
      flip mapAttrs' cfg.profiles (_: profile:
        nameValuePair "Profile${toString profile.id}" {
          Name = profile.name;
          Path = profile.path;
          IsRelative = 1;
          Default = if profile.isDefault then 1 else 0;
        }
      ) // {
        General = {
          StartWithLastProfile = 1;
        };
      };
  
    profilesIni = generators.toINI {} profiles;
  
    mkUserJs = prefs: extraPrefs: ''
      // Generated by Home Manager.
  
      ${concatStrings (mapAttrsToList (name: value: ''
        user_pref("${name}", ${builtins.toJSON value});
      '') prefs)}
  
      ${extraPrefs}
    '';
  
  in
  
  