From 98cc0e04eab1ada42e1ed872b05e0074db4415dd Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sat, 30 Jul 2022 10:44:10 +0300 Subject: [PATCH] wolumonde: add bernbot --- flake.lock | 163 +++++++++++++++++++++++++++++++++++- flake.nix | 2 + hosts/wolumonde/bernbot.nix | 29 +++++++ hosts/wolumonde/default.nix | 1 + secrets/bernbot_token | Bin 0 -> 107 bytes 5 files changed, 192 insertions(+), 3 deletions(-) create mode 100644 hosts/wolumonde/bernbot.nix create mode 100644 secrets/bernbot_token diff --git a/flake.lock b/flake.lock index b875806..2195841 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "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": { "inputs": { "flakeUtils": "flakeUtils", @@ -38,7 +59,39 @@ "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": { + "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, "locked": { "lastModified": 1655976588, @@ -55,13 +108,76 @@ } }, "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": { "alejandra": [ "helix", "nixCargoIntegration", "nixpkgs" ], - "crane": "crane", + "crane": "crane_2", "devshell": [ "helix", "nixCargoIntegration", @@ -169,7 +285,7 @@ "nixpkgs": [ "nixpkgs" ], - "rust-overlay": "rust-overlay" + "rust-overlay": "rust-overlay_2" }, "locked": { "lastModified": 1659072681, @@ -253,10 +369,34 @@ "type": "github" } }, - "nixCargoIntegration": { + "nci": { "inputs": { "devshell": "devshell", "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": [ "helix", "nixpkgs" @@ -363,6 +503,7 @@ }, "root": { "inputs": { + "bernbot": "bernbot", "blog": "blog", "fufexan": "fufexan", "helix": "helix", @@ -376,6 +517,22 @@ } }, "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": { "flake-utils": "flake-utils", "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 3ab41b2..1cd57ff 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,8 @@ fufexan.flake = false; blog.url = "gitlab:yusdacra/yusdacra.gitlab.io"; blog.inputs.nixpkgs.follows = "nixpkgs"; + bernbot.url = "github:yusdacra/bernbot"; + bernbot.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs: let diff --git a/hosts/wolumonde/bernbot.nix b/hosts/wolumonde/bernbot.nix new file mode 100644 index 0000000..b28fe49 --- /dev/null +++ b/hosts/wolumonde/bernbot.nix @@ -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 = {}; +} diff --git a/hosts/wolumonde/default.nix b/hosts/wolumonde/default.nix index f554a94..355fbcb 100644 --- a/hosts/wolumonde/default.nix +++ b/hosts/wolumonde/default.nix @@ -10,6 +10,7 @@ in { imports = [ ./hardware-configuration.nix + ./bernbot.nix ]; boot.cleanTmpDir = true; diff --git a/secrets/bernbot_token b/secrets/bernbot_token new file mode 100644 index 0000000000000000000000000000000000000000..d6a3b39cb7741e955d3ba64074db28fa69cef291 GIT binary patch literal 107 zcmV-x0F?g#M@dveQdv+`03@s0rUjgO25%zr`;CY~!OEk5BXlX6E@4&`gNFP(pw N&Hw;Q9X0)s`W*ZAFPZ=V literal 0 HcmV?d00001