about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-03 20:27:06 +0200
committerSoispha <soispha@vhack.eu>2023-10-03 20:36:39 +0200
commit9c5dd8b282b798eec1d61458f75a0e193d189b63 (patch)
tree015d724c0f18a31012fdca6f32fded14ae63443e
parentfix(hm/conf/taswarrior/projects): Update (diff)
downloadnixos-config-9c5dd8b282b798eec1d61458f75a0e193d189b63.tar.gz
nixos-config-9c5dd8b282b798eec1d61458f75a0e193d189b63.zip
fix(hm/conf/taskserver): Use dots to separate projects
-rw-r--r--hm/soispha/conf/taskwarrior/default.nix20
-rw-r--r--hm/soispha/conf/taskwarrior/hooks/default.nix4
2 files changed, 18 insertions, 6 deletions
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;
         };