From 9c5dd8b282b798eec1d61458f75a0e193d189b63 Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 3 Oct 2023 20:27:06 +0200 Subject: fix(hm/conf/taskserver): Use dots to separate projects --- hm/soispha/conf/taskwarrior/default.nix | 20 ++++++++++++++++---- hm/soispha/conf/taskwarrior/hooks/default.nix | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'hm') diff --git a/hm/soispha/conf/taskwarrior/default.nix b/hm/soispha/conf/taskwarrior/default.nix index f2ca65a9..c1224ee9 100644 --- a/hm/soispha/conf/taskwarrior/default.nix +++ b/hm/soispha/conf/taskwarrior/default.nix @@ -24,9 +24,14 @@ else [ { inherit (project) name; - value = { - read = "project:${project.name}"; - write = "project:${project.name}"; + value = let + name = + if builtins.hasAttr "pname" project + then project.pname + else project.name; + in { + read = "project:${name}"; + write = "project:${name}"; rc = { neorg_path = if builtins.hasAttr "neorg_path" project @@ -36,10 +41,16 @@ }; } ]; - mkProject = project: subproject: + mkProject = project: subproject: let + pname = + if builtins.hasAttr "pname" project + then project.pname + else project.name; + in if builtins.isString subproject then { name = "${project.name}_${subproject}"; + pname = "${pname}.${subproject}"; neorg_path = if builtins.hasAttr "neorg_path_prefix" project then "${project.neorg_path_prefix}/${subproject}/index.norg" @@ -49,6 +60,7 @@ name = builtins.elemAt (builtins.attrNames subproject) 0; in { name = "${project.name}_${name}"; + pname = "${pname}.${name}"; neorg_path_prefix = "${project.prefix}/${project.name}/${name}"; subprojects = builtins.elemAt (builtins.attrValues subproject) 0; }; diff --git a/hm/soispha/conf/taskwarrior/hooks/default.nix b/hm/soispha/conf/taskwarrior/hooks/default.nix index b1b23f3f..a1393d42 100644 --- a/hm/soispha/conf/taskwarrior/hooks/default.nix +++ b/hm/soispha/conf/taskwarrior/hooks/default.nix @@ -12,13 +12,13 @@ mkProject = project: subproject: if builtins.isString subproject then { - name = "${project.name}_${subproject}"; + name = "${project.name}.${subproject}"; prefix = null; } else let name = builtins.elemAt (builtins.attrNames subproject) 0; in { - name = "${project.name}_${name}"; + name = "${project.name}.${name}"; subprojects = builtins.elemAt (builtins.attrValues subproject) 0; prefix = null; }; -- cgit 1.4.1