wolumonde: add bernbot

This commit is contained in:
dusk 2022-07-30 10:44:10 +03:00
parent 4e2c04ddcb
commit 98cc0e04ea
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
5 changed files with 192 additions and 3 deletions

View File

@ -1,5 +1,26 @@
{ {
"nodes": { "nodes": {
"bernbot": {
"inputs": {
"nci": "nci",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1659166662,
"narHash": "sha256-k0tQyUnvRhp1znEe9Kbc40hv3MEKtPczZn62MAH/bQ0=",
"owner": "yusdacra",
"repo": "bernbot",
"rev": "21784b31c90001ad2ff480f148ad4bd487862648",
"type": "github"
},
"original": {
"owner": "yusdacra",
"repo": "bernbot",
"type": "github"
}
},
"blog": { "blog": {
"inputs": { "inputs": {
"flakeUtils": "flakeUtils", "flakeUtils": "flakeUtils",
@ -38,7 +59,39 @@
"type": "github" "type": "github"
} }
}, },
"crane_2": {
"flake": false,
"locked": {
"lastModified": 1654444508,
"narHash": "sha256-4OBvQ4V7jyt7afs6iKUvRzJ1u/9eYnKzVQbeQdiamuY=",
"owner": "ipetkov",
"repo": "crane",
"rev": "db5482bf225acc3160899124a1df5a617cfa27b5",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"devshell": { "devshell": {
"flake": false,
"locked": {
"lastModified": 1658746384,
"narHash": "sha256-CCJcoMOcXyZFrV1ag4XMTpAPjLWb4Anbv+ktXFI1ry0=",
"owner": "numtide",
"repo": "devshell",
"rev": "0ffc7937bb5e8141af03d462b468bd071eb18e1b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"devshell_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1655976588, "lastModified": 1655976588,
@ -55,13 +108,76 @@
} }
}, },
"dream2nix": { "dream2nix": {
"inputs": {
"alejandra": [
"bernbot",
"nci",
"nixpkgs"
],
"crane": "crane",
"devshell": [
"bernbot",
"nci",
"devshell"
],
"flake-utils-pre-commit": [
"bernbot",
"nci",
"nixpkgs"
],
"gomod2nix": [
"bernbot",
"nci",
"nixpkgs"
],
"mach-nix": [
"bernbot",
"nci",
"nixpkgs"
],
"nixpkgs": [
"bernbot",
"nci",
"nixpkgs"
],
"node2nix": [
"bernbot",
"nci",
"nixpkgs"
],
"poetry2nix": [
"bernbot",
"nci",
"nixpkgs"
],
"pre-commit-hooks": [
"bernbot",
"nci",
"nixpkgs"
]
},
"locked": {
"lastModified": 1659134520,
"narHash": "sha256-qg94ijLoS+jbb4w/ww8AqXqjGKN3V0loLzQM+0ry/IE=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "26dce978b1b60800910e874e92be01f7a1fd5839",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "dream2nix",
"type": "github"
}
},
"dream2nix_2": {
"inputs": { "inputs": {
"alejandra": [ "alejandra": [
"helix", "helix",
"nixCargoIntegration", "nixCargoIntegration",
"nixpkgs" "nixpkgs"
], ],
"crane": "crane", "crane": "crane_2",
"devshell": [ "devshell": [
"helix", "helix",
"nixCargoIntegration", "nixCargoIntegration",
@ -169,7 +285,7 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay_2"
}, },
"locked": { "locked": {
"lastModified": 1659072681, "lastModified": 1659072681,
@ -253,10 +369,34 @@
"type": "github" "type": "github"
} }
}, },
"nixCargoIntegration": { "nci": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"dream2nix": "dream2nix", "dream2nix": "dream2nix",
"nixpkgs": [
"bernbot",
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1659161498,
"narHash": "sha256-q6fFrdt/SfbaOQMCJtI5Q7wKP79DJTM6Isfx62Vn/vk=",
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"rev": "790ec04bc74ad051ca6971bdff01e1c2be18aa01",
"type": "github"
},
"original": {
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"type": "github"
}
},
"nixCargoIntegration": {
"inputs": {
"devshell": "devshell_2",
"dream2nix": "dream2nix_2",
"nixpkgs": [ "nixpkgs": [
"helix", "helix",
"nixpkgs" "nixpkgs"
@ -363,6 +503,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"bernbot": "bernbot",
"blog": "blog", "blog": "blog",
"fufexan": "fufexan", "fufexan": "fufexan",
"helix": "helix", "helix": "helix",
@ -376,6 +517,22 @@
} }
}, },
"rust-overlay": { "rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1659149515,
"narHash": "sha256-Kf/0PgVbs4v8L8plR+j00jrDrA4DdoS32osgnXXVc7w=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "96ec48e9d52eba3537629a0bf2eb0fb645314e40",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": [ "nixpkgs": [

View File

@ -22,6 +22,8 @@
fufexan.flake = false; fufexan.flake = false;
blog.url = "gitlab:yusdacra/yusdacra.gitlab.io"; blog.url = "gitlab:yusdacra/yusdacra.gitlab.io";
blog.inputs.nixpkgs.follows = "nixpkgs"; blog.inputs.nixpkgs.follows = "nixpkgs";
bernbot.url = "github:yusdacra/bernbot";
bernbot.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs: let outputs = inputs: let

View File

@ -0,0 +1,29 @@
{
inputs,
pkgs,
lib,
...
}: let
bernbotPkg = inputs.bernbot.packages.${pkgs.system}.bernbot;
in {
systemd.services.bernbot = {
description = "bernbot";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = lib.mkMerge [
{
User = "bernbot";
ExecStart = "${bernbotPkg}/bin/bernbot";
Restart = "on-failure";
RestartSec = 5;
WorkingDirectory = "/var/lib/bernbot";
EnvironmentFile = "${inputs.self}/secrets/bernbot_token";
}
];
};
users.users.bernbot = {
isSystemUser = true;
group = "bernbot";
};
users.groups.bernbot = {};
}

View File

@ -10,6 +10,7 @@
in { in {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
./bernbot.nix
]; ];
boot.cleanTmpDir = true; boot.cleanTmpDir = true;

BIN
secrets/bernbot_token Normal file

Binary file not shown.