about summary refs log tree commit diff
path: root/modules/xdg
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2019-11-05 14:12:59 +0000
committerAlyssa Ross <hi@alyssa.is>2019-12-22 02:41:33 +0000
commitb299665744731644820e4c913fa085d1405ae4d2 (patch)
treeedef7d7002e188ebe01697ec7cd515eb40baa05a /modules/xdg
parentef3559f38d5ef64ff1707b5e19b0d4a51536bea2 (diff)
downloadnixlib-b299665744731644820e4c913fa085d1405ae4d2.tar
nixlib-b299665744731644820e4c913fa085d1405ae4d2.tar.gz
nixlib-b299665744731644820e4c913fa085d1405ae4d2.tar.bz2
nixlib-b299665744731644820e4c913fa085d1405ae4d2.tar.lz
nixlib-b299665744731644820e4c913fa085d1405ae4d2.tar.xz
nixlib-b299665744731644820e4c913fa085d1405ae4d2.tar.zst
nixlib-b299665744731644820e4c913fa085d1405ae4d2.zip
modules/xdg: don't generate empty xdg dirs
Diffstat (limited to 'modules/xdg')
-rw-r--r--modules/xdg/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/xdg/default.nix b/modules/xdg/default.nix
index fc552883fb16..a0417f65859a 100644
--- a/modules/xdg/default.nix
+++ b/modules/xdg/default.nix
@@ -1,7 +1,7 @@
 { lib, pkgs, config, ... }:
 
 let
-  inherit (lib) mapAttrsToList mkOption;
+  inherit (lib) filterAttrs mapAttrsToList mkOption;
   inherit (lib.types) loaOf attrsOf path submodule;
   inherit (pkgs) linkFarm;
 
@@ -29,7 +29,8 @@ in
                                     (mapAttrsToList
                                       (name: path: { inherit name path; })
                                       xdg.config.paths);
-                  }) config.users.users);
+                  }) (filterAttrs (_: { xdg, ... }: xdg.config.paths != {})
+                                  config.users.users));
 
       environment.extraInit = ''
         etc_xdg_config_home=/run/current-system/etc/xdg/nixos/per-user/$USER