summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/profiles.nix
blob: baf9219b4e60f88774bd84d903f2ea3b07afc015 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.personal.profiles;
  mkEnableProfileOption = name: lib.mkEnableOption "${name} profile";
in {
  options.personal.profiles = {
    dev = mkEnableProfileOption "development";
    social = mkEnableProfileOption "social";
    syncing = mkEnableProfileOption "syncing";
    multimedia = mkEnableProfileOption "video";
  };

  config = lib.mkMerge [
    (lib.mkIf cfg.dev {
      home.packages = with pkgs; [python3];
      programs = {
        alacritty.enable = lib.mkDefault config.personal.gui.enable;
        direnv.enable = lib.mkDefault true;
        emacs.enable = lib.mkDefault true;
        git.enable = lib.mkDefault true;
      };
      personal.programs.devenv.enable = true;

      home.file.".config/latexmkrc".text =
        builtins.readFile config.personal.home.dotfiles.latexmkrc;

      services.gpg-agent.enableSshSupport = true;
    })

    (lib.mkIf cfg.multimedia {
      home.packages = with pkgs; [transmission_4-gtk vlc];
      personal = {
        gui.enable = lib.mkForce true;
        firefox.webapps = [
          {
            name = "Netflix";
            genericName = "Streaming service";
            icon = "${pkgs.personal.static.icons.netflix}";
            comment = "Unlimited movies, TV shows, and more.";
            url = "https://www.netflix.com/fr-en/login";
            categories = ["AudioVideo" "Video" "Player"];
          }
          {
            name = "MUBI";
            genericName = "Streaming service";
            icon = "${pkgs.personal.static.icons.mubi}";
            comment = "Watch hand-picked cinema.";
            url = "https://mubi.com";
            categories = ["AudioVideo" "Video" "Player"];
          }
          {
            name = "Deezer";
            genericName = "Streaming service";
            icon = "${pkgs.personal.static.icons.deezer}";
            comment = "Listen to music online";
            url = "https://deezer.com/login";
            categories = ["AudioVideo" "Audio" "Player" "Music"];
          }
        ];
      };
    })

    (lib.mkIf cfg.social {
      home.packages = with pkgs;
        lib.optionals
        (config.personal.gui.enable && config.personal.identities.personal)
        [signal-desktop-bin];
      programs.thunderbird.enable = lib.mkDefault config.personal.gui.enable;
      programs.gpg.enable = true;
      services.gpg-agent.enable = true;
    })

    (lib.mkIf cfg.syncing {
      services = {
        kdeconnect.enable = lib.mkDefault true;
        syncthing.enable = lib.mkDefault true;
      };
    })
  ];
}