From 397b7736788eaeb76a85d719fbc37a366db6dc1c Mon Sep 17 00:00:00 2001 From: tdback Date: Sat, 23 Nov 2024 15:42:43 -0500 Subject: [PATCH] use pipe operator to generate attrs --- users/tdback/xdg.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/users/tdback/xdg.nix b/users/tdback/xdg.nix index 9b49fde..34cab02 100644 --- a/users/tdback/xdg.nix +++ b/users/tdback/xdg.nix @@ -11,12 +11,16 @@ let "videos" ]; + home = config.home.homeDirectory; + defined = { - "documents" = "${config.home.homeDirectory}/documents"; - "download" = "${config.home.homeDirectory}/downloads"; + "documents" = "${home}/documents"; + "download" = "${home}/downloads"; }; - userDirs = builtins.map (dir: { name = dir; value = defined.${dir} or null; }) dirs; + userDirs = + builtins.map (dir: { name = dir; value = defined.${dir} or null; }) dirs + |> builtins.listToAttrs; in { xdg = { @@ -24,6 +28,6 @@ in userDirs = { enable = true; createDirectories = true; - } // builtins.listToAttrs userDirs; + } // userDirs; }; }