about summary refs log tree commit diff
path: root/modules/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos')
-rw-r--r--modules/nixos/common/xdg.nix38
1 files changed, 10 insertions, 28 deletions
diff --git a/modules/nixos/common/xdg.nix b/modules/nixos/common/xdg.nix
index b02c0ae..b46c350 100644
--- a/modules/nixos/common/xdg.nix
+++ b/modules/nixos/common/xdg.nix
@@ -4,41 +4,23 @@
   this,
   ...
 }:
-with lib; {
-  imports = let
-    withBase = s: ["home-manager" "users" my.username "xdg" s];
-  in [
-    (mkAliasOptionModule ["dirs" "cache"] (withBase "cacheHome"))
-    (mkAliasOptionModule ["dirs" "config"] (withBase "configHome"))
-    (mkAliasOptionModule ["dirs" "data"] (withBase "dataHome"))
-    (mkAliasOptionModule ["dirs" "state"] (withBase "stateHome"))
-    (mkAliasOptionModule ["userDirs"] (withBase "userDirs"))
-  ];
-
+with lib; let
+  cfg = config.nixfiles.modules.common.xdg;
+in {
   xdg.portal = mkIf this.isHeadful {
     enable = true;
   };
 
   hm.xdg = mkMerge [
-    {
+    (with cfg; {
       enable = true;
 
-      userDirs = let
-        inherit (config.my) home;
-        tmp = home + "/tmp";
-      in {
-        enable = true;
-
-        desktop = tmp;
-        documents = "${home}/doc";
-        download = tmp;
-        music = tmp;
-        pictures = tmp;
-        publicShare = "${home}/share";
-        templates = tmp;
-        videos = tmp;
-      };
-    }
+      inherit cacheHome;
+      inherit configHome;
+      inherit dataHome;
+      inherit stateHome;
+      inherit userDirs;
+    })
     (mkIf this.isHeadful {
       mimeApps = {
         enable = true;

Consider giving Nix/NixOS a try! <3