nixos-config/nixos/components/gui/taskwarrior.nix

97 lines
2.8 KiB
Nix
Raw Normal View History

2023-06-10 20:57:07 +02:00
{ config, pkgs, lib, ... }:
with lib;
2023-11-07 16:47:53 +01:00
with types;
let
mkMagicMergeOption = { description ? "", example ? { }, default ? { }, apply ? id, ... }:
mkOption {
inherit example description default apply;
type = with lib.types;
let
valueType = nullOr
(oneOf [
bool
int
float
str
(attrsOf valueType)
(listOf valueType)
]) // {
description = "bool, int, float or str";
emptyValue.value = { };
};
in
valueType;
};
2024-05-21 13:06:20 +02:00
2024-05-22 09:28:11 +02:00
#taskwarrior-ui = pkgs.unstable.taskwarrior-tui;
taskwarrior-tui = pkgs.taskwarrior-tui;
2024-05-21 13:06:20 +02:00
2023-11-07 16:47:53 +01:00
in
2023-06-10 20:57:07 +02:00
{
options.components.gui.taskwarrior.enable = mkOption {
2023-11-07 16:47:53 +01:00
type = bool;
2023-06-10 20:57:07 +02:00
default = config.components.gui.enable;
};
2023-11-07 16:47:53 +01:00
options.components.gui.taskwarrior.config = mkMagicMergeOption {
type = attrs;
default = { };
};
2023-06-10 20:57:07 +02:00
config = mkIf (config.components.gui.taskwarrior.enable) {
environment.systemPackages = with pkgs; [
taskwarrior
2024-05-21 13:06:20 +02:00
taskwarrior-tui
2023-06-10 20:57:07 +02:00
timewarrior
2024-01-05 14:49:18 +01:00
miller
2023-06-10 20:57:07 +02:00
tasksh
(pkgs.writeShellScriptBin "tsak" ''${pkgs.taskwarrior}/bin/task "$@"'')
(pkgs.writers.writeBashBin "calendar" ''
${pkgs.taskwarrior}/bin/task calendar
${pkgs.taskwarrior}/bin/task calendar_report
'')
unstable.vit
2024-05-21 13:06:20 +02:00
(pkgs.writers.writeBashBin "active" "${taskwarrior-tui}/bin/taskwarrior-tui -r active")
(pkgs.writers.writeBashBin "todo" "${taskwarrior-tui}/bin/taskwarrior-tui -r todo")
2023-06-10 20:57:07 +02:00
taskwarrior-hooks
vdirsyncer
khal
(pkgs.writers.writeBashBin "kalendar" ''
${pkgs.vdirsyncer}/bin/vdirsyncer sync
${pkgs.khal}/bin/ikhal
'')
2024-05-19 00:20:54 +02:00
# todo : before deleting this, put it in logseq
2023-11-07 16:47:53 +01:00
(python3Packages.bugwarrior.overrideAttrs (old: {
version = "develop";
src = pkgs.fetchFromGitHub {
owner = "ralphbean";
repo = "bugwarrior";
rev = "eb19a702a698f9c8c3ce2a1fe41f35872d9ae398";
sha256 = "sha256-Geon+ddE58WJ10L4unotzvmZj1Ye0yjZHVQgrR2YWgE=";
};
propagatedBuildInputs = old.propagatedBuildInputs ++ [
python3Packages.pydantic
python3Packages.tomli
python3Packages.email-validator
python3Packages.packaging
];
}))
2023-06-10 20:57:07 +02:00
];
2023-11-07 16:47:53 +01:00
#home-manager.users.mainUser.home.file.".config/bugwarrior/bugwarriorrc".source = ./bugwarriorc.ini;
#home-manager.users.mainUser.home.file.".config/bugwarrior/bugwarriorrc".source = (pkgs.formats.toml { }).generate "bugwarriorrc.toml" config.components.gui.taskwarrior.config;
home-manager.users.mainUser.home.file.".config/bugwarrior/bugwarrior.toml".source = (pkgs.formats.toml { }).generate "bugwarriorrc.toml" config.components.gui.taskwarrior.config;
2023-06-10 20:57:07 +02:00
};
}