mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 08:45:02 +01:00
widetom in systemd
This commit is contained in:
parent
0d83cecc9f
commit
1c94ed5f5d
2 changed files with 46 additions and 31 deletions
|
|
@ -1,33 +1,47 @@
|
|||
{ config, ... }: {
|
||||
age.secrets.widetom_bot_token.file = ../../secrets/widetom_bot_token.age;
|
||||
age.secrets.widetom_config_toml.file = ../../secrets/widetom_config_toml.age;
|
||||
{ config, pkgs, lib, my-projects-versions, ... }:
|
||||
let
|
||||
widetom = pkgs.rustPlatform.buildRustPackage {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "Noratrieb";
|
||||
repo = "widetom";
|
||||
rev = my-projects-versions.widetom;
|
||||
hash = "sha256-lSjlDozwKRLF62jsDaWo+8+rcQdeEgurEnuw00hk3o8=";
|
||||
};
|
||||
pname = "widetom";
|
||||
version = "0.1.0";
|
||||
cargoHash = "sha256-AWbdPcDc+QOW7U/FYbqlIsg+3MwfggKCTCw1z/ZbSEE=";
|
||||
meta = {
|
||||
mainProgram = "widertom";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
age.secrets.widetom_bot_token = {
|
||||
file = ../../secrets/widetom_bot_token.age;
|
||||
owner = config.users.users.widetom.name;
|
||||
};
|
||||
age.secrets.widetom_config_toml = {
|
||||
file = ../../secrets/widetom_config_toml.age;
|
||||
owner = config.users.users.widetom.name;
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
container_name: widetom
|
||||
image: "docker.noratrieb.dev/widetom:33d17387"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/widetom:/app/config"
|
||||
environment:
|
||||
CONFIG_PATH: /app/config/config.toml
|
||||
BOT_TOKEN_PATH: /app/config/bot_token
|
||||
*/
|
||||
widetom = {
|
||||
image = "docker.noratrieb.dev/widetom:33d17387";
|
||||
volumes = [
|
||||
"${config.age.secrets.widetom_config_toml.path}:/config.toml"
|
||||
"${config.age.secrets.widetom_bot_token.path}:/token"
|
||||
];
|
||||
systemd.services.widetom = {
|
||||
description = "widetom, the extremely funny discord bot";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
environment = {
|
||||
CONFIG_PATH = "/config.toml";
|
||||
BOT_TOKEN_PATH = "/token";
|
||||
BOT_TOKEN_PATH = config.age.secrets.widetom_bot_token.path;
|
||||
CONFIG_PATH = config.age.secrets.widetom_config_toml.path;
|
||||
};
|
||||
login = {
|
||||
registry = "docker.noratrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
ExecStart = lib.getExe widetom;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.widetom = {
|
||||
group = "widetom";
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups.widetom = { };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
"quotdd": "e922229e1d9e055be35dabd112bafc87a0686548",
|
||||
"does-it-build": "81790825173d87f89656f66f12a123bc99e2f6f1",
|
||||
"upload.files.noratrieb.dev": "0124fa5ba5446cb463fb6b3c4f52e7e6b84e5077",
|
||||
"cluelessh": "5f203d0f5ba2639043bd5bd1c3687c406d6abac1"
|
||||
"cluelessh": "c711cd405da4b7951e554577d09c9576bedf7970",
|
||||
"widetom": "33d1738799618d72fe2b86896f766cbfea58dc76"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue