about summary refs log tree commit diff stats
path: root/hm/soispha/conf/taskwarrior/firefox/default.nix
blob: 494d269a218ae2d47d506a1d1a21fd81ab9ab084 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  extensions,
  userChrome,
  extraConfig,
  bookmarks,
  search,
  lib,
  config,
  ...
}: let
  hexLib = import ./lib.nix {inherit lib;};
  inherit (config.soispha.taskwarrior.projects) projects;

  mkFirefoxProfile = {
    name,
    id,
  }: {
    inherit name;
    value = {
      isDefault = false;
      inherit name id extensions userChrome search bookmarks extraConfig;
    };
  };
  projects_id =
    builtins.map (project: {
      name = project;
      id =
        hexLib.fromHexString
        (builtins.hashString "sha256" project);
    })
    projects;
  firefoxProfiles = builtins.listToAttrs (builtins.map mkFirefoxProfile projects_id);
in
  firefoxProfiles