mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
update to 19.03
This commit is contained in:
@@ -8,7 +8,7 @@ let
|
||||
startAt = bot.time;
|
||||
serviceConfig.Type = "oneshot";
|
||||
wants = [ "network-online.target" ];
|
||||
script = lists.concatStringsSep "\n" (map (chatId: ''
|
||||
script = strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$(${bot.command})" ${
|
||||
|
||||
32
modules/todoist.nix
Normal file
32
modules/todoist.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.niveum.todoist;
|
||||
todoist = pkgs.unstable.callPackage <packages/todoist.nix> {};
|
||||
in {
|
||||
options.niveum.todoist = {
|
||||
enable = mkEnableOption "todoist CLI";
|
||||
token = mkOption { type = types.strMatching "[0-9a-f]+"; };
|
||||
color = mkOption { type = types.bool; default = true; };
|
||||
};
|
||||
|
||||
config = {
|
||||
environment.systemPackages = mkIf cfg.enable [
|
||||
(pkgs.unstable.writers.writeDashBin "todoist" ''
|
||||
${todoist}/bin/todoist $@
|
||||
'')
|
||||
];
|
||||
|
||||
home-manager.users.me.home.file.".todoist.config.json".text = mkIf cfg.enable (builtins.toJSON {
|
||||
token = cfg.token;
|
||||
color = cfg.color;
|
||||
});
|
||||
|
||||
systemd.user.services.todoist-sync = {
|
||||
enable = cfg.enable;
|
||||
wants = [ "network-online.target" ];
|
||||
startAt = "*:0/5";
|
||||
script = ''${todoist}/bin/todoist sync'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user