about summary refs log tree commit diff
path: root/modules/darwin/common
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-08-02 13:41:53 +0300
committerAzat Bahawi <azat@bahawi.net>2023-08-02 13:41:53 +0300
commit17928bd2eabb2dca1c870c8af3f43eeac96e181b (patch)
treeaddb81d79b2511aa647349f63da376c296d711de /modules/darwin/common
parent2023-07-31 (diff)
2023-08-02
Diffstat (limited to 'modules/darwin/common')
-rw-r--r--modules/darwin/common/default.nix1
-rw-r--r--modules/darwin/common/xdg.nix25
2 files changed, 26 insertions, 0 deletions
diff --git a/modules/darwin/common/default.nix b/modules/darwin/common/default.nix
index b03e431..4d4824f 100644
--- a/modules/darwin/common/default.nix
+++ b/modules/darwin/common/default.nix
@@ -7,5 +7,6 @@ _: {
     ./secrets.nix
     ./shell.nix
     ./users.nix
+    ./xdg.nix
   ];
 }
diff --git a/modules/darwin/common/xdg.nix b/modules/darwin/common/xdg.nix
new file mode 100644
index 0000000..9e798ad
--- /dev/null
+++ b/modules/darwin/common/xdg.nix
@@ -0,0 +1,25 @@
+{
+  config,
+  lib,
+  ...
+}:
+with lib; let
+  cfg = config.nixfiles.modules.common.xdg;
+in {
+  hm.home.sessionVariables = with cfg;
+    {
+      XDG_CACHE_HOME = cacheHome;
+      XDG_CONFIG_HOME = configHome;
+      XDG_DATA_HOME = dataHome;
+      XDG_STATE_HOME = stateHome;
+    }
+    // (with userDirs; {
+      XDG_DOCUMENTS_DIR = documents;
+      XDG_DOWNLOAD_DIR = download;
+      XDG_MUSIC_DIR = music;
+      XDG_PICTURES_DIR = pictures;
+      XDG_PUBLICSHARE_DIR = publicShare;
+      XDG_TEMPLATES_DIR = templates;
+      XDG_VIDEOS_DIR = videos;
+    });
+}

Consider giving Nix/NixOS a try! <3