about summary refs log tree commit diff
path: root/home/profiles/multimedia/default.nix
blob: 5890fb71eb8618d53ef8b65f10fdb68109a4b943 (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
{ config, lib, pkgs, ... }:
let
  cfg = config.profiles.multimedia;

  fixSopsPrefix = x: y: builtins.replaceStrings [ "%r" ] [ "/run/user/${toString x}" ] y;
in
{
  imports = [
    ../../../modules/nixpkgs.nix
  ];

  options.profiles.multimedia = {
    enable = lib.mkEnableOption
      "A profile that enables the system to be used for consuming multimedia contents.";
  };

  config = lib.mkIf cfg.enable {
    home.packages = with pkgs; [ vlc playerctl cider spotify ];

    sops.secrets.freshrss-api-password = { };

    programs.newsboat = {
      enable = true;
      autoReload = true;

      extraConfig = ''
        urls-source "freshrss"
        freshrss-url "https://rss.exotic.sh/api/greader.php"
        freshrss-login "sefidel"
        freshrss-passwordeval "cat ${fixSopsPrefix 1000 config.sops.secrets.freshrss-api-password.path}"

        # Vim-like movement
        bind-key j down feedlist
        bind-key k up feedlist
        bind-key j next articlelist
        bind-key k prev articlelist
        bind-key J next-feed articlelist
        bind-key K prev-feed articlelist
        bind-key j down article
        bind-key k up article

        # Colorscheme to work with softjelly
        color listnormal        white default
        color listnormal_unread white default
        color listfocus         white default reverse bold
        color listfocus_unread  white default reverse bold
        color info              yellow black
        color background        white default
        color article           white default

        # Additional Highlight groups
        highlight article "(^Feed:.*|^Title:.*|^Author:.*)" cyan default bold
        highlight article "(^Link:.*|^Date:.*)" default default
        highlight article "https?://[^ ]+" green default

        highlight article "^(Title):.*$" blue default
        highlight article "\\[[0-9][0-9]*\\]" magenta default bold
        highlight article "\\[image\\ [0-9]+\\]" green default bold
        highlight article "\\[embedded flash: [0-9][0-9]*\\]" green default bold
        highlight article ":.*\\(link\\)$" cyan default
        highlight article ":.*\\(image\\)$" blue default
        highlight article ":.*\\(embedded flash\\)$" magenta default
      '';
    };

    nixpkgs.allowedUnfree = [ "spotify" ];
  };
}