Skip to content

Commit d81f372

Browse files
axelkarGaetanLepage
authored andcommitted
plugins/aw-watcher: init
1 parent a3b16fa commit d81f372

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{ lib, ... }:
2+
let
3+
inherit (lib.nixvim) defaultNullOpts;
4+
in
5+
lib.nixvim.plugins.mkNeovimPlugin {
6+
name = "aw-watcher";
7+
moduleName = "aw_watcher";
8+
packPathName = "aw-watcher.nvim";
9+
package = "aw-watcher-nvim";
10+
11+
maintainers = [ lib.maintainers.axka ];
12+
13+
settingsOptions = {
14+
bucket = {
15+
hostname = defaultNullOpts.mkStr { __raw = "vim.uv.os_gethostname()"; } ''
16+
The hostname to be presented to the ActivityWatch server.
17+
Defaults to the hostname of the computer.
18+
'';
19+
20+
name = defaultNullOpts.mkStr { __raw = "'aw-watcher-neovim_' .. bucket.hostname'"; } ''
21+
The name of the bucket in the ActivityWatch server.
22+
'';
23+
};
24+
aw_server = {
25+
host = defaultNullOpts.mkStr "127.0.0.1" ''
26+
Host to connect to.
27+
'';
28+
29+
port = defaultNullOpts.mkUnsignedInt 5600 ''
30+
Port to connect to.
31+
'';
32+
33+
ssl_enable = defaultNullOpts.mkBool false ''
34+
Whether the ActivityWatch server should be connected to using HTTPS.
35+
'';
36+
37+
pulsetime = defaultNullOpts.mkUnsignedInt 30 ''
38+
The maximum amount of time (in seconds) between two consecutive events
39+
(heartbeats) with the same data (e.g. same file path) that will cause
40+
them to be merged into a single event. This is useful for saving on
41+
storage space and disk I/O.
42+
'';
43+
};
44+
};
45+
46+
settingsExample = {
47+
aw_server = {
48+
host = "127.0.0.1";
49+
port = 5600;
50+
pulsetime = 60;
51+
};
52+
};
53+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
empty = {
3+
# don't run tests as they try to access the network.
4+
test.runNvim = false;
5+
plugins.aw-watcher.enable = true;
6+
};
7+
8+
defaults = {
9+
# don't run tests as they try to access the network.
10+
test.runNvim = false;
11+
plugins.aw-watcher = {
12+
enable = true;
13+
14+
settings = {
15+
bucket = {
16+
hostname = "nixvim";
17+
name = "aw-watcher-neovim_nixvim";
18+
};
19+
aw_server = {
20+
host = "127.0.0.1";
21+
port = 5600;
22+
ssl_enable = false;
23+
pulsetime = 30;
24+
};
25+
};
26+
};
27+
};
28+
29+
example = {
30+
# don't run tests as they try to access the network.
31+
test.runNvim = false;
32+
plugins.aw-watcher = {
33+
enable = true;
34+
35+
settings = {
36+
aw_server = {
37+
host = "127.0.0.1";
38+
port = 5600;
39+
pulsetime = 60;
40+
};
41+
};
42+
};
43+
};
44+
}

0 commit comments

Comments
 (0)