Compare commits

..
3 Commits
3 changed files with 55 additions and 2 deletions
+5 -2
View File
@@ -92,8 +92,11 @@ mkdir -p /mnt/home/blake/.config/sops/age
# --- move config ---
echo "moving nix config into /mnt/home/blake/.nix ..."
cp -r /bootstrap_nix /mnt/home/blake/.nix
#echo "moving hardware into /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME ..."
#cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME
echo "moving hardware into /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME ..."
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME
cd /mnt/home/blake/.nix
git add /mnt/home/blake/.nix/hosts/nixos/$HOSTNAME
# --- write age key ---
+4
View File
@@ -30,6 +30,10 @@ in
enable = true;
vendor = "nvidia";
};
keepalive = {
enable = true;
url = "";
};
};
holocron = {
syncthing.enable = true;
+46
View File
@@ -0,0 +1,46 @@
{
pkgs,
config,
lib,
...
}:
let
service = "keepalive";
cfg = config.system.${service};
in {
options.system.${service} = {
enable = lib.mkEnableOption "enables ${service}";
url = lib.mkOption {
type = lib.types.str;
default = "";
description = "url to ping for uptime-kuma keepalive";
};
interval = lib.mkOption {
type = lib.types.str;
default = "60s";
};
};
config = lib.mkIf cfg.enable {
systemd.services.keepalive = {
description = "send push for uptime kuma heartbeat";
serviceConfig = {
Type = "oneshot";
};
script = ''
${pkgs.curl}/bin/curl -fsSk \
"${cfg.url}" \
>/dev/null
'';
};
systemd.timers.keepalive = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "30s";
OnUnitActiveSec = cfg.interval;
Unit = "keepalive.service";
};
};
};
}