aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name')
-rw-r--r--modules/by-name/at/atuin/module.nix16
-rw-r--r--modules/by-name/ta/taskwarrior/module.nix10
2 files changed, 17 insertions, 9 deletions
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix
index 9e3f46a7..700f50fb 100644
--- a/modules/by-name/at/atuin/module.nix
+++ b/modules/by-name/at/atuin/module.nix
@@ -17,10 +17,12 @@
in {
options.soispha.programs.atuin = {
enable = lib.mkEnableOption "atuin";
+
+ enableAge = lib.mkEnableOption "atuin with age keys";
};
config = lib.mkIf cfg.enable {
- age.secrets.atuin_encryption_key = {
+ age.secrets.atuin_encryption_key = lib.mkIf cfg.enableAge {
file = ./secrets/encryption_key.age;
mode = "700";
owner = "soispha";
@@ -37,14 +39,18 @@ in {
# We can do this on our own.
enableZshIntegration = false;
settings = {
- key_path = "${config.age.secrets.atuin_encryption_key.path}";
+ key_path = lib.mkMerge [
+ (lib.mkIf cfg.enableAge "${config.age.secrets.atuin_encryption_key.path}")
+ (lib.mkIf (!cfg.enableAge)
+ "${config.home-manager.users.soispha.xdg.dataHome}/atuin/atuin_secret_key.key")
+ ];
- sync = {
+ sync = lib.mkIf cfg.enableAge {
# The v2 sync API
records = true;
};
- auto_sync = true;
- sync_address = "https://atuin-sync.vhack.eu";
+ auto_sync = lib.mkIf cfg.enableAge true;
+ sync_address = lib.mkIf cfg.enableAge "https://atuin-sync.vhack.eu";
# Use the rather reasonable syntax of `skim` to search.
search_mode = "skim";
diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix
index 4c174244..bb881768 100644
--- a/modules/by-name/ta/taskwarrior/module.nix
+++ b/modules/by-name/ta/taskwarrior/module.nix
@@ -76,6 +76,8 @@ in {
options.soispha.programs.taskwarrior = {
enable = lib.mkEnableOption "taskwarrior";
+ enableAge = lib.mkEnableOption "taskwarrior with age keys";
+
includeFiles = lib.mkOption {
type = lib.types.attrsOf lib.types.path;
description = "Extra files to include in the taskwarrior config";
@@ -108,17 +110,17 @@ in {
inherit mkHook;
};
- age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf cfg.enable {
+ age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf (cfg.enable && cfg.enableAge) {
file = ./secrets/sync_server_encryption_key.age;
mode = "700";
owner = "soispha";
group = "users";
};
- soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf cfg.enable config.age.secrets.taskwarrior_sync_server_encryption_key.path;
+ soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf (cfg.enable && cfg.enableAge) config.age.secrets.taskwarrior_sync_server_encryption_key.path;
home-manager.users.soispha = lib.mkIf cfg.enable {
- services.taskwarrior-sync = {
+ services.taskwarrior-sync = lib.mkIf cfg.enableAge {
enable = true;
package = pkgs.taskwarrior3;
};
@@ -148,7 +150,7 @@ in {
};
};
- sync.server = {
+ sync.server = lib.mkIf cfg.enableAge {
client_id = "a3619d43-031f-4f85-848f-5512804f9a1d";
url = "https://taskchampion.vhack.eu";
};