-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsandbox.nix
More file actions
47 lines (44 loc) · 1.34 KB
/
sandbox.nix
File metadata and controls
47 lines (44 loc) · 1.34 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
{
inputs = {
nixpkgs.url = "git+https://mirrors.tuna.tsinghua.edu.cn/git/nixpkgs.git/?ref=nixos-23.11";
llonebot = {
url = "github:LLOneBot/llonebot.nix"; # nix flake lock --update-input llonebot
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
};
};
outputs =
{ nixpkgs, llonebot, ... }:
{
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
(
{ pkgs, ... }:
let
llonebotConfig = {
display = ":666";
pmhq_host = "0.0.0.0";
pmhq_port = 13000;
quick_login_qq = ""; # 快速登录QQ号
};
myLLOneBot = (pkgs.llonebot.buildLLOneBotSandbox llonebotConfig).sandbox;
in
{
systemd.services.llonebot = {
enable = true;
description = "LLOneBot Service";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
# 完全保留原服务配置
serviceConfig = {
ExecStart = "${myLLOneBot}/bin/sandbox";
Restart = "always";
User = "root";
};
};
}
)
];
};
};
}