trigger icomidal script with systemd timer + update icomidal
This commit is contained in:
parent
7dbb5b33f0
commit
5b45bbb373
3 changed files with 29 additions and 8 deletions
|
|
@ -59,6 +59,30 @@ let secrets = import ../secrets.nix; in
|
||||||
systemd.services."getty@tty1".enable = false;
|
systemd.services."getty@tty1".enable = false;
|
||||||
systemd.services."autovt@tty1".enable = false;
|
systemd.services."autovt@tty1".enable = false;
|
||||||
|
|
||||||
|
# Run icomidal script daily
|
||||||
|
systemd.timers.icomidal = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "daily";
|
||||||
|
Persistent = true;
|
||||||
|
Unit = "icomidal.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.services.icomidal = {
|
||||||
|
script = ''
|
||||||
|
${icomidal}/bin/icomidal > /var/lib/icomidal/komida.ics
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "icomidal";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
users.users.icomidal = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "icomidal";
|
||||||
|
};
|
||||||
|
users.groups.icomidal = {};
|
||||||
|
|
||||||
services.xserver.xkb.layout = "us";
|
services.xserver.xkb.layout = "us";
|
||||||
services.xserver.xkb.options = "eurosign:e";
|
services.xserver.xkb.options = "eurosign:e";
|
||||||
|
|
||||||
|
|
@ -191,9 +215,6 @@ let secrets = import ../secrets.nix; in
|
||||||
|
|
||||||
# Update CloudFlare DNS
|
# Update CloudFlare DNS
|
||||||
"*/1 * * * * cloudflare-dns curl --request PUT --url https://api.cloudflare.com/client/v4/zones/${secrets.cloudflare_zone_id}/dns_records/${secrets.cloudflare_dns_record_id} --header 'Content-Type: application/json' --header 'Authorization: Bearer ${secrets.cloudflare_api_token}' --data '{ \"comment\": \"Domain verification record\", \"name\": \"@\", \"proxied\": false, \"settings\": {}, \"tags\": [], \"ttl\": 60, \"content\": \"'$(curl https://ipinfo.io/ip)'\", \"type\": \"A\" }' | jq -r '.success' | systemd-cat -t 'cloudflare-dns'"
|
"*/1 * * * * cloudflare-dns curl --request PUT --url https://api.cloudflare.com/client/v4/zones/${secrets.cloudflare_zone_id}/dns_records/${secrets.cloudflare_dns_record_id} --header 'Content-Type: application/json' --header 'Authorization: Bearer ${secrets.cloudflare_api_token}' --data '{ \"comment\": \"Domain verification record\", \"name\": \"@\", \"proxied\": false, \"settings\": {}, \"tags\": [], \"ttl\": 60, \"content\": \"'$(curl https://ipinfo.io/ip)'\", \"type\": \"A\" }' | jq -r '.success' | systemd-cat -t 'cloudflare-dns'"
|
||||||
|
|
||||||
# Update iComidal - every morning at 5:30
|
|
||||||
"30 5 * * * duckdns ${icomidal}/bin/icomidal >> /schijf/public/komida.ics"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -7,11 +7,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1758628924,
|
"lastModified": 1758705293,
|
||||||
"narHash": "sha256-95sfywK2SW7gyFOmdTaUElnH/ad/Vf1ahRPkcyr3bPQ=",
|
"narHash": "sha256-+JNimzIqv+J5k+glVTKTt4BbsmjA/d0kwsDxnWScDcg=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "1aa2e6087099858c1234fe91f3a4893d98162308",
|
"rev": "4a9b55b2db83869a27b3dca4f04e0e805feb31ca",
|
||||||
"revCount": 5,
|
"revCount": 11,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://deemz.org/git/joeri/icomidal"
|
"url": "https://deemz.org/git/joeri/icomidal"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
deemz = nixpkgs-stable.lib.nixosSystem {
|
deemz = nixpkgs-stable.lib.nixosSystem {
|
||||||
specialArgs = { inherit system; icomidal=icomidal; };
|
specialArgs = { inherit system; icomidal=icomidal.packages.${system}.default; };
|
||||||
modules = [
|
modules = [
|
||||||
./deemz.org/configuration.nix
|
./deemz.org/configuration.nix
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue