feat(taskwarrior): add enable option
This commit is contained in:
@@ -63,7 +63,6 @@
|
||||
bash.addBinToPath = true;
|
||||
};
|
||||
anki.enable = true;
|
||||
anki.enable = true;
|
||||
k8s.k9s.enable = true;
|
||||
taskwarrior.enable = true;
|
||||
audio.enable = true;
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
anki.enable = true;
|
||||
k8s.k9s.enable = true;
|
||||
taskwarrior.enable = true;
|
||||
secrets.enable = true;
|
||||
my.yubikey.enable = true;
|
||||
audio.enable = true;
|
||||
ssh.enable = true;
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
redis.enable = true;
|
||||
};
|
||||
anki.enable = true;
|
||||
taskwarrior.enable = true;
|
||||
k8s.enable = true;
|
||||
shell.enable = true;
|
||||
my.stylix.enable = true;
|
||||
|
||||
@@ -10,10 +10,15 @@
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.taskwarrior;
|
||||
sops = myUtils.sopsAvailability config osConfig;
|
||||
standalone = osConfig == null;
|
||||
in
|
||||
lib.optionalAttrs standalone {
|
||||
{
|
||||
options.taskwarrior.enable = lib.mkEnableOption "taskwarrior";
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.optionalAttrs standalone {
|
||||
sops = {
|
||||
secrets = myUtils.mkSopsSecrets "${toString inputs.nix-secrets}/secrets" null {
|
||||
taskwarrior = [
|
||||
@@ -31,11 +36,10 @@ lib.optionalAttrs standalone {
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
// {
|
||||
|
||||
}
|
||||
// {
|
||||
warnings =
|
||||
lib.optional (!sops.available && config.programs.taskwarrior.enable)
|
||||
lib.optional (!sops.available)
|
||||
"taskwarrior is enabled, but sops templates are not available. taskwarrior sync will not be configured.";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
@@ -70,10 +74,12 @@ lib.optionalAttrs standalone {
|
||||
colorTheme = "dark-256";
|
||||
config = {
|
||||
recurrence = "off";
|
||||
reserved.lines = 3; # without this I would have to scroll up 3 lines
|
||||
reserved.lines = 3;
|
||||
};
|
||||
extraConfig = lib.optionalString sops.available ''
|
||||
include ${sops.templates."taskrc.d/sync".path}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
{ config, ... }:
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
cfg = config.taskwarrior;
|
||||
inherit (config.secrets) owner;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
options.taskwarrior.enable = lib.mkEnableOption "taskwarrior";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
secrets.groups.taskwarrior = [
|
||||
"sync-server-url"
|
||||
"sync-server-client-id"
|
||||
|
||||
Reference in New Issue
Block a user