mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-24 00:56:16 +01:00
Remove camptules
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
0b55629af0
commit
5eb84dd9e7
|
@ -1,36 +0,0 @@
|
|||
{ nglib, camptules, nixpkgs }:
|
||||
nglib.makeSystem {
|
||||
system = "x86_64-linux";
|
||||
name = "nixng-camptules";
|
||||
inherit nixpkgs;
|
||||
config = ({ pkgs, config, nglib, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
camptules.nixngModule
|
||||
];
|
||||
|
||||
config = {
|
||||
dumb-init = {
|
||||
enable = true;
|
||||
type.services = {};
|
||||
};
|
||||
|
||||
services.camptules = {
|
||||
enable = true;
|
||||
package =
|
||||
let
|
||||
youtube-dl = pkgs.writeShellScriptBin "youtube-dl"
|
||||
''
|
||||
${pkgs.yt-dlp}/bin/yt-dlp "$@"
|
||||
'';
|
||||
in
|
||||
pkgs.writeShellScriptBin "camptules"
|
||||
''
|
||||
export PATH=$PATH:${youtube-dl}/bin:${pkgs.ffmpeg}/bin
|
||||
cd /secrets
|
||||
${lib.trace camptules.defaultPackage."x86_64-linux".outPath camptules.defaultPackage."x86_64-linux"}/bin/camptules
|
||||
'';
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
21
flake.lock
21
flake.lock
|
@ -1,25 +1,5 @@
|
|||
{
|
||||
"nodes": {
|
||||
"camptules": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1641345147,
|
||||
"narHash": "sha256-2DwiEp/pxQ/gIMlJyYOM/q2sEXaJ4LYqhdvW9TrFjpA=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "67759ba6aede849780dcedcc3b316ccc1c0084b0",
|
||||
"revCount": 39,
|
||||
"type": "git",
|
||||
"url": "https://gitea.redalder.org/ThyW/camptules"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.redalder.org/ThyW/camptules"
|
||||
}
|
||||
},
|
||||
"emacs-htmlize": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -152,7 +132,6 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"camptules": "camptules",
|
||||
"nixng": "nixng",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"website": "website"
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
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:
|
||||
|
@ -35,7 +31,6 @@
|
|||
ingressToothpick = import ./containers/ingress-toothpick.nix base;
|
||||
ingressBlowhole = import ./containers/ingress-blowhole.nix base;
|
||||
website = import ./containers/website.nix (base // { inherit (inputs.website) website; });
|
||||
camptules = (import ./containers/camptules.nix (base // { inherit (inputs) camptules; }));
|
||||
gitea = import ./containers/gitea.nix base;
|
||||
minecraft = import ./containers/minecraft.nix base;
|
||||
mosquitto = import ./containers/mosquitto.nix base;
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
resource "vault_policy" "camputules-policy" {
|
||||
name = "camptules-policy"
|
||||
policy = <<EOF
|
||||
path "kv/data/camptules" {
|
||||
capabilities = ["read"]
|
||||
}
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "nomad_job" "camptules" {
|
||||
jobspec = file("${path.module}/job/camptules.hcl")
|
||||
|
||||
hcl2 {
|
||||
enabled = true
|
||||
vars = {
|
||||
flake_ref = "${var.flake_host}?rev=${var.flake_rev}&ref=${var.flake_ref}"
|
||||
flake_sha = var.flake_sha
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
variable "flake_ref" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "flake_sha" {
|
||||
type = string
|
||||
}
|
||||
|
||||
job "camptules" {
|
||||
datacenters = [ "homelab-1" ]
|
||||
type = "service"
|
||||
|
||||
group "camptules" {
|
||||
count = 1
|
||||
|
||||
network {
|
||||
mode = "bridge"
|
||||
}
|
||||
|
||||
task "camptules" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
nix_flake_ref = "${var.flake_ref}#nixngSystems.camptules.config.system.build.toplevel"
|
||||
nix_flake_sha = var.flake_sha
|
||||
entrypoint = [ "init" ]
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 512
|
||||
memory = 128
|
||||
memory_max = 192
|
||||
}
|
||||
|
||||
vault {
|
||||
policies = ["camptules-policy"]
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOF
|
||||
{{ with secret "kv/data/camptules" }}
|
||||
{{ .Data.data.token }}
|
||||
{{ end }}
|
||||
EOF
|
||||
destination = "secrets/cfg"
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOF
|
||||
{{ with secret "kv/data/camptules" }}
|
||||
{{ .Data.data.ytb_api_key }}
|
||||
{{ end }}
|
||||
EOF
|
||||
destination = "secrets/ytb-api-key"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue