2022-06-27 23:06:38 +02:00
|
|
|
{ zentralwerk, oparl-scraper, config, pkgs, ... }:
|
2022-05-28 00:12:18 +02:00
|
|
|
let
|
2022-06-27 23:06:38 +02:00
|
|
|
ratsinfo-scraper = import oparl-scraper { inherit pkgs; };
|
2022-05-28 01:25:54 +02:00
|
|
|
|
|
|
|
netConfig = zentralwerk.lib.config.site.net.serv;
|
|
|
|
|
2022-05-28 00:12:18 +02:00
|
|
|
in
|
|
|
|
{
|
2022-06-16 21:18:04 +02:00
|
|
|
c3d2.deployment = {
|
|
|
|
server = "server10";
|
|
|
|
mounts = [ "etc" "home" "var"];
|
2022-05-28 00:12:18 +02:00
|
|
|
};
|
|
|
|
|
2022-06-17 23:23:08 +02:00
|
|
|
networking.hostName = "oparl";
|
2022-05-28 00:12:18 +02:00
|
|
|
|
|
|
|
users.users.oparl = {
|
2022-05-28 02:03:47 +02:00
|
|
|
isNormalUser = true;
|
2022-05-28 01:56:45 +02:00
|
|
|
createHome = true;
|
2022-05-28 00:12:18 +02:00
|
|
|
group = "oparl";
|
|
|
|
};
|
|
|
|
users.groups.oparl = {};
|
2022-05-28 01:25:54 +02:00
|
|
|
systemd.tmpfiles.rules = [
|
2022-05-28 02:29:48 +02:00
|
|
|
"C ${config.users.users.oparl.home}/.ssh/id_ed25519 0400 oparl oparl - ${config.sops.secrets."users/oparl/id_ed25519".path}"
|
|
|
|
"z ${config.users.users.oparl.home}/.ssh/id_ed25519 0400 oparl oparl - -"
|
2022-05-28 01:25:54 +02:00
|
|
|
];
|
2022-07-31 18:13:03 +02:00
|
|
|
|
|
|
|
sops = {
|
|
|
|
defaultSopsFile = ./secrets.yaml;
|
|
|
|
secrets."users/oparl/id_ed25519" = {};
|
|
|
|
};
|
2022-05-28 00:12:18 +02:00
|
|
|
|
|
|
|
systemd.services.oparl-scraper = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2022-05-28 03:28:39 +02:00
|
|
|
after = [ "systemd-tmpfiles-setup.service" "network-online.target" ];
|
2022-05-28 00:12:18 +02:00
|
|
|
startAt = "daily";
|
|
|
|
serviceConfig = {
|
|
|
|
User = "oparl";
|
|
|
|
Group = "oparl";
|
|
|
|
WorkingDirectory = "${config.users.users.oparl.home}";
|
|
|
|
};
|
|
|
|
path = with pkgs; [
|
2022-05-29 14:02:20 +02:00
|
|
|
git openssh poppler_utils ratsinfo-scraper
|
2022-05-28 00:12:18 +02:00
|
|
|
];
|
|
|
|
script = ''
|
|
|
|
if [ -d data ]; then
|
|
|
|
pushd data
|
|
|
|
git pull
|
|
|
|
popd
|
|
|
|
else
|
|
|
|
git clone git@github.com:offenesdresden/dresden-ratsinfo.git data
|
|
|
|
fi
|
|
|
|
|
2022-05-28 03:24:17 +02:00
|
|
|
pushd data
|
|
|
|
git config user.name Astro
|
|
|
|
git config user.email astro@spaceboyz.net
|
|
|
|
popd
|
|
|
|
|
2022-05-28 00:12:18 +02:00
|
|
|
scrape
|
|
|
|
pushd data
|
|
|
|
find . -name \*.json -exec git add "{}" +
|
2022-05-29 02:44:09 +02:00
|
|
|
git commit -m update || true
|
2022-06-19 00:56:20 +02:00
|
|
|
git push origin master
|
2022-05-28 11:23:14 +02:00
|
|
|
popd
|
2022-05-28 00:12:18 +02:00
|
|
|
|
|
|
|
meetings2ics data/meetings/ > data/meetings.ics
|
|
|
|
pushd data
|
|
|
|
git add meetings.ics
|
2022-05-29 02:44:09 +02:00
|
|
|
git commit -m "update meetings.ics" || true
|
2022-06-19 00:56:20 +02:00
|
|
|
git push origin master
|
2022-05-28 00:12:18 +02:00
|
|
|
popd
|
|
|
|
|
|
|
|
files_extract
|
|
|
|
pushd data
|
|
|
|
find . -name \*.txt -exec git add {} +
|
2022-05-29 02:44:09 +02:00
|
|
|
git commit -m update\ text || true
|
2022-05-28 00:12:18 +02:00
|
|
|
git push origin master
|
|
|
|
'';
|
|
|
|
};
|
2022-05-28 00:30:04 +02:00
|
|
|
|
|
|
|
system.stateVersion = "22.05";
|
2022-05-28 00:12:18 +02:00
|
|
|
}
|