-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
90 lines (84 loc) · 2.85 KB
/
Copy pathflake.nix
File metadata and controls
90 lines (84 loc) · 2.85 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
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
{
description = "Shiryoku: A terminal-based utility designed to explore the mechanics of email protocols, asynchronous scheduling, and telemetry.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "shiryoku";
version = "1.0.0";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [
pkgs.pkg-config
];
buildInputs = [
# Security / Network (reqwest, lettre)
pkgs.openssl
# Wayland Support (rfd, clipboard, winit)
pkgs.wayland
pkgs.libxkbcommon # Needed for keyboard handling on Wayland
# X11 Support (rfd, clipboard, winit)
pkgs.xorg.libX11
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXrandr
];
};
}
)
// {
homeManagerModules.default = {
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.programs.shiryoku;
jsonFormat = pkgs.formats.json {};
in {
options.programs.shiryoku = {
enable = mkEnableOption "Shiryoku: A terminal-based email utility with scheduling and telemetry features";
settings = mkOption {
type = jsonFormat.type;
default = {};
description = "Configuration settings for config.json, defining user identity, SMTP credentials, and backend connection details.";
example = literalExpression ''
{
identity = {
name = "Jane Doe";
role = "Research Fellow";
department = "Computer Science";
institution = "University of Technology";
phone = "+1 555 0123";
emails = [
"jane.doe@university.edu"
"jane.private@example.com"
];
};
smtp_username = "jane.doe@example.com";
smtp_app_password = "abcd-efgh-ijkl-mnop";
worker_url = "https://shiryoku-backend.jane-doe.workers.dev";
api_secret = "your_secure_api_secret_here";
}
'';
};
};
config = mkIf cfg.enable {
home.packages = [self.packages.${pkgs.system}.default];
xdg.configFile."shiryoku/config.json".source =
jsonFormat.generate "config.json" cfg.settings;
};
};
};
}