-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy patht3code-server.nix
More file actions
59 lines (57 loc) · 1.97 KB
/
Copy patht3code-server.nix
File metadata and controls
59 lines (57 loc) · 1.97 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
57
58
59
{
config,
inputs,
lib,
makeEnable,
pkgs,
...
}: let
cfg = config.myModules.t3codeServer;
environmentId = "fleet:${config.networking.hostName}";
enabledModule = makeEnable config "myModules.t3codeServer" false {
users.users.imalison.linger = true;
home-manager.sharedModules = [inputs.t3code-integration.homeManagerModules.t3code-server];
home-manager.users.imalison = {config, ...}: {
services.t3code = {
enable = true;
# The module defaults to the flake's plain `t3code` package, whose
# home.packages entry shadows the system-level client on PATH. The
# overlaid pkgs.t3code is the client build, whose t3code-desktop is
# wrapped with --password-store=gnome-libsecret; without that flag
# Electron safeStorage falls back to basic_text under Hyprland and the
# desktop silently loses the connection catalog.
package = pkgs.t3code;
repositoryRoot = "/srv/dotfiles";
tailscaleServe.port = cfg.tailscaleServePort;
systemdTarget = cfg.startTarget;
};
systemd.user.services.t3code-headless = {
Unit = {
After = ["t3code-managed-connections.service"];
Requires = ["t3code-managed-connections.service"];
};
Service = {
Environment = ["T3CODE_ENVIRONMENT_ID=${environmentId}"];
EnvironmentFile = "${config.xdg.configHome}/t3code/managed-access.env";
};
};
};
};
in
enabledModule
// {
options = lib.recursiveUpdate enabledModule.options {
myModules.t3codeServer = {
tailscaleServePort = lib.mkOption {
type = lib.types.port;
default = 443;
description = "Tailnet-only HTTPS port exposed by Tailscale Serve.";
};
startTarget = lib.mkOption {
type = lib.types.str;
default = "default.target";
description = "User systemd target that starts the headless T3 Code service.";
};
};
};
}