summary refs log tree commit diff stats
path: root/modules/glance.nix
blob: 027fa2c162b08dc9eb87ca45909660c6d7c17acd (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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{ pkgs, libs, config, ... }:
let
  unstable = import <nixos-unstable> {};
in
{

  services.glance = {
    enable = true;
    package = unstable.glance;
    settings = {
      server = {
        host = "localhost";
        port = 5678;
        assets-path = "/var/glance-assets";
        base_url = "dash.krinitsin.com";
      };

      theme = {
        background-color = "204 14 20";
        primary-color = "41 32 75";
        positive-color = "172 29 61";
        negative-color = "358 69 68";
        text-saturation-multiplier = 1.0;
      };
    };

    settings.pages = [
      {
        name = "Home";
        columns = [
          {
            size = "small";
            widgets = [
              {
                type = "calendar";
              }
            ];
          }
          {
            size = "full";
            widgets = [
              {
                location = "Munich, Germany";
                type = "weather";
              }
              {
                type = "lobsters";
                title = "News";
                sort-by = "hot";
              }
            ];
          }
          {
            size = "small";
            widgets = [
              {
                cache = "1m";
                title = "Services";
                sites = [
                  {
                    title = "Vaultwarden";
                    url = "https://vault.krinitsin.com";
                    icon = "/assets/vaultwarden.png";
                  }
                  {
                    title = "Git";
                    url = "https://git.krinitsin.com";
                    icon = "/assets/git.png";
                  }
                  {
                    title = "Mealie";
                    url = "https://recipes.krinitsin.com";
                    icon = "/assets/mealie.png";
                  }
                  {
                    title = "PDF";
                    url = "https://pdf.krinitsin.com";
                    icon = "/assets/stirling-pdf.png";
                  }
                  {
                    title = "Polaris";
                    url = "https://music.krinitsin.com";
                    icon = "/assets/polaris.webp";
                  }
                  {
                    title = "Radicale";
                    url = "https://caldav.krinitsin.com";
                    icon = "/assets/radicale.png";
                  }
                  {
                    title = "Monit";
                    url = "https://status.krinitsin.com/";
                    check-url = "https://google.com";
                    icon = "/assets/monit.png";
                  }
                  {
                    title = "Shopping List";
                    url = "https://krinitsin.com/shopping/";
                    check-url = "https://google.com";
                    icon = "/assets/shopping-list.png";
                  }
                  {
                    title = "Webmail";
                    url = "https://webmail.krinitsin.com";
                    icon = "/assets/roundcube.png";
                  }
                ];
                type = "monitor";
              }
            ];
          }
        ];
      }
    ];

    openFirewall = true;
  };
  
  services.nginx.virtualHosts."dash.krinitsin.com" = {
    forceSSL = true;
    useACMEHost = "krinitsin.com";
    locations."/".proxyPass = "http://localhost:5678";
  };

  security.acme.certs."krinitsin.com".extraDomainNames = [ "dash.krinitsin.com" ];

  services.monit.config = ''
    check process glance with matching "glance"
    start program = "${pkgs.systemd}/bin/systemctl start glance"
    stop program = "${pkgs.systemd}/bin/systemctl stop glance"
  '';
}