Release v2.2.0

This commit is contained in:
Hadi
2024-08-19 20:32:10 +02:00
parent caaa500232
commit e6f66110f0
22 changed files with 194 additions and 191 deletions

View File

@@ -1,4 +1,19 @@
{ pkgs, ... }: {
{ pkgs, ... }:
let
bitcoin-price = pkgs.writeShellScriptBin "bitcoin-price" ''
[ ! -d "/home/hadi/btcprice" ] && ${pkgs.git}/bin/git clone git@github.com:anotherhadi/btcprice /home/hadi/btcprice
cd "/home/hadi/btcprice"
price=$(${pkgs.curl}/bin/curl eur.rate.sx/1BTC)
echo "# Bitcoin Price in EURO" >README.md
echo "" >>README.md
echo "1 Bitcoin = $price" >>README.md
echo "" >>README.md
echo "Date: $(date)" >>README.md
${pkgs.git}/bin/git add .
${pkgs.git}/bin/git commit -m "Update price (hadi)"
${pkgs.git}/bin/git push -u origin main
'';
in {
systemd.timers."bitcoin-git" = {
wantedBy = [ "timers.target" ];
timerConfig = {
@@ -10,17 +25,7 @@
systemd.services."bitcoin-git" = {
script = ''
[ ! -d "/home/hadi/btcprice" ] && ${pkgs.git}/bin/git clone git@github.com:anotherhadi/btcprice /home/hadi/btcprice
cd "/home/hadi/btcprice"
price=$(${pkgs.curl}/bin/curl eur.rate.sx/1BTC)
echo "# Bitcoin Price in EURO" >README.md
echo "" >>README.md
echo "1 Bitcoin = $price" >>README.md
echo "" >>README.md
echo "Date: $(date)" >>README.md
${pkgs.git}/bin/git add .
${pkgs.git}/bin/git commit -m "Update price (hadi)"
${pkgs.git}/bin/git push -u origin main
${bitcoin-price}
exit 0
'';
serviceConfig = {

View File

@@ -17,7 +17,6 @@
# haugene/transmission-openvpn
# '';
# };
# TODO: launch the container at boot
networking.firewall.allowedTCPPorts = [ 9091 ];
}