Add camptules

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2021-10-17 22:21:32 +02:00
parent 0cb9550abe
commit 255984e3f3
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
5 changed files with 97 additions and 8 deletions

23
containers/camptules.nix Normal file
View file

@ -0,0 +1,23 @@
nglib: camptules:
(nglib "x86_64-linux").makeSystem {
system = "x86_64-linux";
name = "nixng-camptules";
config = ({ pkgs, config, nglib, lib, ... }:
{
imports = [
camptules.nixngModule
];
config = {
dumb-init = {
enable = true;
type.services = {};
};
services.camptules = {
enable = true;
package = camptules.defaultPackage."x86_64-linux";
};
};
});
}

View file

@ -1,5 +1,25 @@
{
"nodes": {
"camptules": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1632771837,
"narHash": "sha256-Nrhcl6EvS+V2LbUcEkwg3yrfa6O1Em6YygBmrhoktfA=",
"ref": "master",
"rev": "ade0f1216960f2aa7ddf0616c55ec16d6445d54b",
"revCount": 28,
"type": "git",
"url": "https://gitea.redalder.org/ThyW/camptules"
},
"original": {
"type": "git",
"url": "https://gitea.redalder.org/ThyW/camptules"
}
},
"emacs-htmlize": {
"flake": false,
"locked": {
@ -55,11 +75,11 @@
]
},
"locked": {
"lastModified": 1630445254,
"narHash": "sha256-+BnHazNZ+jVAY4AQI5784kkFidMxfiGatY3ZH9gjkQM=",
"lastModified": 1633802209,
"narHash": "sha256-N3vUBJCQgLsN3gaCb/dN015BANKrPzU26b/11q/ndVY=",
"owner": "MagicRB",
"repo": "NixNG",
"rev": "0f2e6e88f26ff31429f17b96b53d6e80b8280d70",
"rev": "644cf374bce2b154241a7db59d290d318757f40c",
"type": "github"
},
"original": {
@ -89,16 +109,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1628865210,
"narHash": "sha256-dB3IA8AYUQDXH+Xy/6nbv4QpIbVl88DphbcxJSUYiX4=",
"lastModified": 1630761588,
"narHash": "sha256-7GXckvZy7DGh2KIyfdArqwnyeSc5Owy1fumEDQyd8eY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a445f5829889959d65ad65e5c961d5c67e1cd677",
"rev": "a51aa6523bd8ee985bc70987909eff235900197a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.05",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -121,6 +141,7 @@
},
"root": {
"inputs": {
"camptules": "camptules",
"nixng": "nixng",
"nixpkgs": "nixpkgs",
"website": "website"

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-21.05";
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
nixng = {
url = "github:MagicRB/NixNG";
@ -10,6 +10,10 @@
url = "git+https://gitea.redalder.org/Magic_RB/website";
inputs.nixpkgs.follows = "nixpkgs";
};
camptules = {
url = "git+https://gitea.redalder.org/ThyW/camptules";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nixng, ... }@inputs:
@ -25,6 +29,7 @@
ingress = (import ./containers/ingress.nix nixng.lib);
website = (import ./containers/website.nix inputs.website.website nixng.lib);
jmusicbot = (import ./containers/jmusicbot.nix nixng.lib);
camptules = (import ./containers/camptules.nix nixng.lib inputs.camptules);
};
in
{
@ -77,6 +82,7 @@
hydraPostgresql = makeJob self.ociImages.hydraPostgresql;
ingress = makeJob self.ociImages.ingress;
jmusicbot = makeJob self.ociImages.jmusicbot;
camptules = makeJob self.ociImages.camptules;
};

View file

@ -0,0 +1,3 @@
path "kv/data/camptules" {
capabilities = ["read"]
}

View file

@ -0,0 +1,36 @@
job "camptules" {
datacenters = [ "homelab-1" ]
type = "service"
group "camptules" {
count = 1
task "camptules" {
driver = "docker"
config {
image = "nixng-camptules:local"
memory_hard_limit = 192
}
resources {
cpu = 512
memory = 128
}
vault {
policies = ["camptules-policy"]
}
template {
data = <<EOF
{{ with secret "kv/data/camptules" }}
BOT_TOKEN={{ .Data.data.token }}
{{ end }}
EOF
destination = "secrets/env"
env = true
}
}
}
}