-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (52 loc) · 1.55 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (52 loc) · 1.55 KB
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
{
description = "tm - minimal CLI time tracker";
outputs = { self }: {
overlays.default = final: prev: {
tm = final.rustPlatform.buildRustPackage {
pname = "tm";
version = "0.1.0";
src = self;
cargoLock.lockFile = ./Cargo.lock;
cargoBuildFlags = [ "--package" "tm" ];
doCheck = false;
};
tm-daemon = final.rustPlatform.buildRustPackage {
pname = "tm-daemon";
version = "0.1.0";
src = self;
cargoLock.lockFile = ./Cargo.lock;
cargoBuildFlags = [ "--package" "tm-daemon" ];
buildInputs = with final.darwin.apple_sdk.frameworks; [
AppKit
Foundation
];
doCheck = false;
};
};
darwinModules.default = { config, lib, pkgs, ... }:
let
cfg = config.services.tm-daemon;
in {
options.services.tm-daemon = {
enable = lib.mkEnableOption "tm time tracker menu bar daemon";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.tm-daemon;
defaultText = lib.literalExpression "pkgs.tm-daemon";
};
};
config = lib.mkIf cfg.enable {
launchd.user.agents.tm-daemon = {
serviceConfig = {
Label = "com.iamradek.tm-daemon";
ProgramArguments = [ "${cfg.package}/bin/tm-daemon" ];
RunAtLoad = true;
KeepAlive = true;
StandardOutPath = "/tmp/tm-daemon.log";
StandardErrorPath = "/tmp/tm-daemon.err";
};
};
};
};
};
}