Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d97fdee7a | ||
|
|
6d194f8103 | ||
|
|
a0980ffd87 |
+5
-2
@@ -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 ---
|
||||
|
||||
@@ -30,6 +30,10 @@ in
|
||||
enable = true;
|
||||
vendor = "nvidia";
|
||||
};
|
||||
keepalive = {
|
||||
enable = true;
|
||||
url = "";
|
||||
};
|
||||
};
|
||||
holocron = {
|
||||
syncthing.enable = true;
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user