1
0

hosts/web-2: add chaosevent.clerie.de

This commit is contained in:
clerie 2023-06-13 17:53:45 +02:00
parent 4715a5340e
commit 8936e6a8b5
5 changed files with 76 additions and 2 deletions

View File

@ -21,6 +21,26 @@
"type": "github" "type": "github"
} }
}, },
"chaosevents": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1686652220,
"narHash": "sha256-/tMdQgMVy7zpI2Bel3jwMPTeu+yh/Wp+3AhqcNe3KlI=",
"ref": "refs/heads/main",
"rev": "0e2fcf3195a2919ca9ea808cc2adedd4af7ff743",
"revCount": 1,
"type": "git",
"url": "https://git.clerie.de/clerie/chaosevents.git"
},
"original": {
"type": "git",
"url": "https://git.clerie.de/clerie/chaosevents.git"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -134,6 +154,7 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"chaosevents": "chaosevents",
"fernglas": "fernglas", "fernglas": "fernglas",
"nixos-exporter": "nixos-exporter", "nixos-exporter": "nixos-exporter",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",

View File

@ -6,6 +6,10 @@
url = "github:ryantm/agenix"; url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
chaosevents = {
url = "git+https://git.clerie.de/clerie/chaosevents.git";
inputs.nixpkgs.follows = "nixpkgs";
};
fernglas = { fernglas = {
url = "github:wobcom/fernglas"; url = "github:wobcom/fernglas";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -19,7 +23,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, fernglas, nixos-exporter, solid-xmpp-alarm, ... }@inputs: let outputs = { self, nixpkgs, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ... }@inputs: let
helper = (import ./lib/flake-helper.nix) inputs; helper = (import ./lib/flake-helper.nix) inputs;
in { in {
clerie.hosts = { clerie.hosts = {

View File

@ -0,0 +1,46 @@
{ pkgs, ... }:
{
users.users."chaosevents" = {
isSystemUser = true;
group = "chaosevents";
};
users.groups."chaosevents" = {};
systemd.tmpfiles.rules = [
"d /var/lib/chaosevents - chaosevents chaosevents - -"
];
services.nginx = {
virtualHosts."chaosevents.clerie.de" = {
enableACME = true;
forceSSL = true;
root = "/var/lib/chaosevents";
};
};
systemd.services."chaosevents" = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "/var/lib/chaosevents";
RuntimeDirectory = "nixos-validator";
User = "chaosevents";
Group = "chaosevents";
ExecStart = ''
${pkgs.chaosevents}/bin/chaosevents /var/lib/chaosevents
'';
};
};
systemd.timers."chaosevents" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "hourly";
RandomizedDelaySec = "1h";
};
after = [ "network-online.target" ];
};
}

View File

@ -7,6 +7,7 @@
./blog.nix ./blog.nix
./bubblesort.nix ./bubblesort.nix
./bula22.nix ./bula22.nix
./chaosevents.nix
./clerie.nix ./clerie.nix
./drop.nix ./drop.nix
./gitea.nix ./gitea.nix

View File

@ -1,4 +1,4 @@
{ self, nixpkgs, agenix, fernglas, nixos-exporter, solid-xmpp-alarm, ... }@inputs: { self, nixpkgs, agenix, chaosevents, fernglas, nixos-exporter, solid-xmpp-alarm, ... }@inputs:
rec { rec {
generateNixosSystem = { generateNixosSystem = {
@ -28,6 +28,8 @@ rec {
(_: _: { (_: _: {
inherit (agenix.packages."x86_64-linux") inherit (agenix.packages."x86_64-linux")
agenix; agenix;
inherit (chaosevents.packages."x86_64-linux")
chaosevents;
}) })
]; ];
clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; }; clerie.monitoring = nixpkgs.lib.attrsets.optionalAttrs (group != null) { serviceLevel = group; };