feeds: add a script to initialize a feed, as well

This commit is contained in:
colin 2023-01-11 10:41:39 +00:00
parent 78782d5f7e
commit e6d9edf27d
2 changed files with 24 additions and 9 deletions

View File

@ -136,16 +136,20 @@
(_: full: full.sane // { inherit (full) sane uninsane-dot-org; })
self.legacyPackages;
apps."x86_64-linux" = {
update-feeds = {
type = "app";
program =
let
pkgs = self.legacyPackages."x86_64-linux";
script = pkgs.feeds.passthru.updateScript;
in "${script}";
apps."x86_64-linux" =
let
pkgs = self.legacyPackages."x86_64-linux";
in {
update-feeds = {
type = "app";
program = "${pkgs.feeds.passthru.updateScript}";
};
init-feed = {
type = "app";
program = "${pkgs.feeds.passthru.initFeedScript}";
};
};
};
templates = {
python-data = {

View File

@ -22,5 +22,16 @@
passthru.updateScript = pkgs.writeShellScript
"feeds-update"
(builtins.concatStringsSep "\n" update-scripts);
passthru.initFeedScript = pkgs.writeShellScript
"init-feed"
''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git
name="$1"
mkdir modules/data/feeds/sources/"$name"
touch modules/data/feeds/sources/"$name"/default.json
git add modules/data/feeds/sources/"$name"/default.json
'';
}
))