Backup Chaospott markdown
This commit is contained in:
parent
c1bcacb7c0
commit
a20f9fe608
3 changed files with 47 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
||||||
./media-jellyfin.nix
|
./media-jellyfin.nix
|
||||||
./media-youtube.nix
|
./media-youtube.nix
|
||||||
./media-castget.nix
|
./media-castget.nix
|
||||||
|
./media-curl.nix
|
||||||
|
|
||||||
# logging
|
# logging
|
||||||
./loki.nix
|
./loki.nix
|
||||||
|
|
45
nixos/machines/chungus/media-curl.nix
Normal file
45
nixos/machines/chungus/media-curl.nix
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
configuration = {
|
||||||
|
Chaospott37C3Tickets = {
|
||||||
|
url = "https://md.chaospott.de/171s8-_cQCyX_tUca_Jxqw/download";
|
||||||
|
target = "/media/curl/37C3";
|
||||||
|
output = "$( date +%H:%M:%S )-TicketPlaning.md";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
downloadScript =
|
||||||
|
name: { url
|
||||||
|
, target
|
||||||
|
, output
|
||||||
|
}: pkgs.writers.writeDash "curl-script-${name}" ''
|
||||||
|
mkdir -p "${target}"
|
||||||
|
curl "${url}" -o "${target}/${output}"
|
||||||
|
'';
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
systemd.services.curl-download = {
|
||||||
|
after = [ "network.target" ];
|
||||||
|
path = [ pkgs.curl ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = "media";
|
||||||
|
Group = "media";
|
||||||
|
};
|
||||||
|
script = (concatStringsSep "\n"
|
||||||
|
(mapAttrsToList downloadScript configuration)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.timers.curl-download = {
|
||||||
|
enable = true;
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "hourly";
|
||||||
|
Persistent = "true";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -27,6 +27,7 @@
|
||||||
set -e
|
set -e
|
||||||
${pkgs.psmisc}/bin/killall gpg-agent
|
${pkgs.psmisc}/bin/killall gpg-agent
|
||||||
rm -r ~/.gnupg/private-keys-v1.d/
|
rm -r ~/.gnupg/private-keys-v1.d/
|
||||||
|
${pkgs.gnupg}/bin/gpg --card-status
|
||||||
echo "now the new key should work"
|
echo "now the new key should work"
|
||||||
'')
|
'')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue