diff --git a/nix/sources.json b/nix/sources.json index 56d48cae..70bb2814 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -11,6 +11,12 @@ "url": "https://github.com/srid/emanote/archive/584d52c4c7071e643ce738db9db0196f17071518.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "mastodon_digest": { + "branch": "main", + "repo": "git@hera.m-0.eu:mastodon_digest", + "rev": "abea31381316d762d3c8eecc6f732eb6620e259e", + "type": "git" + }, "hexa-nur-packages": { "branch": "master", "description": "My personal NUR repository: [maintainer=@mweinelt] ", diff --git a/nixos/machines/hera/cloud.nix b/nixos/machines/hera/cloud.nix index de23c2b0..757bf2d7 100644 --- a/nixos/machines/hera/cloud.nix +++ b/nixos/machines/hera/cloud.nix @@ -131,6 +131,17 @@ in { serviceConfig.ExecStart = "${pkgs.python3}/bin/python -m http.server --bind ${hosts.vpn.hera} 8842 -d /var/www/rss"; wantedBy = ["multi-user.target"]; }; + mastodon-digest = { + script = '' + ln -fs ${pkgs.privatePath "mastodon-env"} .env + now=$(date "+%Y-%m-%d") + mkdir -p /var/www/rss/mastodon/$now-highlights + mkdir -p /var/www/rss/mastodon/$now-all + ${pkgs.mastodon_digest}/bin/mastodon_digest -o /var/www/rss/mastodon/$now-highlights -n 24 -t lax --theme light + ${pkgs.mastodon_digest}/bin/mastodon_digest -o /var/www/rss/mastodon/$now-all -n 24 -t all --theme light -f list:3811 + ''; + startAt = "19:59"; + }; } // nextcloudServices mainHostName; }; diff --git a/overlays/10-previews.nix b/overlays/10-previews.nix index abd9346c..67275a97 100644 --- a/overlays/10-previews.nix +++ b/overlays/10-previews.nix @@ -1,9 +1,7 @@ self: super: let unstable = import super.sources.nixos-unstable {}; - bot_commit = (builtins.fromJSON (builtins.readFile ../nix/sources.json)).nixpkgs-bot.rev; - nom_commit = (builtins.fromJSON (builtins.readFile ../nix/sources.json)).nix-output-monitor.rev; - nom = builtins.getFlake "git+ssh://git@hera.m-0.eu/nix-output-monitor?rev=${nom_commit}&ref=main"; - bot = builtins.getFlake "git+ssh://git@hera.m-0.eu/nixpkgs-bot?rev=${bot_commit}&ref=main"; + sources = builtins.fromJSON (builtins.readFile ../nix/sources.json); + myFlake = name: (builtins.getFlake "git+ssh://git@hera.m-0.eu/${name}?rev=${sources.${name}.rev}&ref=main").packages.x86_64-linux; in { inherit unstable; unstableHaskellPackages = unstable.haskellPackages; @@ -17,6 +15,7 @@ in { emanote helix ; - nixpkgs-bot = bot.packages.x86_64-linux.default; - nix-output-monitor = nom.packages.x86_64-linux.default; + nixpkgs-bot = (myFlake "nixpkgs-bot").default; + nix-output-monitor = (myFlake "nix-output-monitor").default; + inherit (myFlake "mastodon_digest") mastodon_digest; }