feeds: add a script to initialize a feed, as well
This commit is contained in:
parent
78782d5f7e
commit
e6d9edf27d
22
flake.nix
22
flake.nix
|
@ -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 = {
|
||||
|
|
|
@ -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
|
||||
'';
|
||||
}
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue