diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-08-02 13:41:53 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-08-02 13:41:53 +0300 |
commit | 17928bd2eabb2dca1c870c8af3f43eeac96e181b (patch) | |
tree | addb81d79b2511aa647349f63da376c296d711de /modules/nixos | |
parent | 2023-07-31 (diff) |
2023-08-02
Diffstat (limited to 'modules/nixos')
-rw-r--r-- | modules/nixos/common/xdg.nix | 38 |
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; |