From 17928bd2eabb2dca1c870c8af3f43eeac96e181b Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Wed, 2 Aug 2023 13:41:53 +0300 Subject: 2023-08-02 --- modules/nixos/common/xdg.nix | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'modules/nixos/common') 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; -- cgit 1.4.1