flake: update-feeds now actually does update *all* feeds

This commit is contained in:
2023-01-11 10:31:00 +00:00
parent 91275f3723
commit 78782d5f7e
2 changed files with 17 additions and 9 deletions

View File

@@ -142,8 +142,7 @@
program =
let
pkgs = self.legacyPackages."x86_64-linux";
args = pkgs.feeds."xkcd.com".passthru.updateScript;
script = pkgs.writeShellScript "update-feeds" (builtins.concatStringsSep " " args);
script = pkgs.feeds.passthru.updateScript;
in "${script}";
};
};

View File

@@ -7,11 +7,20 @@
# TODO: dependency-inject this.
sane-data = import ../../modules/data { inherit lib; };
template = self.callPackage ./template.nix;
in lib.mapAttrs
(name: feed-details: template {
feedName = name;
jsonPath = "modules/data/feeds/sources/${name}/default.json";
inherit (feed-details) url;
})
sane-data.feeds
feed-pkgs = lib.mapAttrs
(name: feed-details: template {
feedName = name;
jsonPath = "modules/data/feeds/sources/${name}/default.json";
inherit (feed-details) url;
})
sane-data.feeds;
update-scripts = lib.mapAttrsToList
(name: feed: builtins.concatStringsSep " " feed.passthru.updateScript)
feed-pkgs;
in
feed-pkgs // {
passthru.updateScript = pkgs.writeShellScript
"feeds-update"
(builtins.concatStringsSep "\n" update-scripts);
}
))