added some debug scripts

This commit is contained in:
John Lancaster
2024-12-17 01:09:22 -06:00
parent d0544a89ff
commit 7216a90f90
3 changed files with 15 additions and 11 deletions

View File

@@ -1,7 +1,6 @@
{ pkgs, lib, userSettings, ... }: { pkgs, lib, userSettings, systemSettings, ... }:
let let
stateVersion = "24.05"; stateVersion = "24.05";
unstable = import <nixos-unstable> {};
adHome = "/srv/appdaemon"; adHome = "/srv/appdaemon";
adNixPath = "${adHome}/ad-nix"; adNixPath = "${adHome}/ad-nix";
adPath = "/usr/src/app"; adPath = "/usr/src/app";
@@ -26,10 +25,7 @@ in
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch") (pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch") (pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nfs" "sudo nixos-rebuild switch --flake ${adNixPath} --impure") (pkgs.writeShellScriptBin "nfs" "sudo nixos-rebuild switch --flake ${adNixPath} --impure")
(pkgs.writeShellScriptBin "ads" '' (pkgs.writeShellScriptBin "ads" "cd ${adPath} && nix develop --no-pure-eval ${adNixPath}/appdaemon")
cd ${adPath}
nix develop --no-pure-eval ${adNixPath}/appdaemon
'')
(pkgs.writeShellScriptBin "ad-clone" '' (pkgs.writeShellScriptBin "ad-clone" ''
if [ ! -d ${adPath} ]; then if [ ! -d ${adPath} ]; then
sudo git clone -b ${adBranch} ${adRepo} ${adPath} sudo git clone -b ${adBranch} ${adRepo} ${adPath}
@@ -38,16 +34,14 @@ in
echo "${adPath} already exists" echo "${adPath} already exists"
fi fi
'') '')
# unstable.uv
bash bash
git git
eza eza
gh gh
sops sops
# appdaemon
]; ];
time.timeZone = "America/Chicago"; time.timeZone = "${systemSettings.timeZone}";
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.oci-containers.backend = "docker"; virtualisation.oci-containers.backend = "docker";

View File

@@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
let let
lokiHost = "192.168.1.174:3100"; lokiHost = "192.168.1.174:3100";
in in
@@ -7,6 +7,11 @@ in
SupplementaryGroups = [ "docker" ]; SupplementaryGroups = [ "docker" ];
}; };
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "pc" "systemctl status promtail.service")
(pkgs.writeShellScriptBin "pw" "journalctl -u promtail.service -b -n 25 -f")
];
services.promtail = { services.promtail = {
enable = true; enable = true;
configuration = { configuration = {

View File

@@ -1,4 +1,4 @@
{ config, ... }: { config, pkgs, ... }:
let let
influxURL = "http://panoptes.john-stream.com:8086"; influxURL = "http://panoptes.john-stream.com:8086";
organization = "homelab"; organization = "homelab";
@@ -8,6 +8,11 @@ in
{ {
sops.secrets."telegraf_influx_token" = { }; sops.secrets."telegraf_influx_token" = { };
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "tc" "systemctl status telegraf.service")
(pkgs.writeShellScriptBin "tw" "journalctl -u telegraf.service -b -n 25 -f")
];
systemd.services.telegraf = { systemd.services.telegraf = {
environment = { environment = {
INFLUX_WRITE_TOKEN = token; INFLUX_WRITE_TOKEN = token;