use pipe operator to generate attrs
This commit is contained in:
parent
164c430909
commit
397b773678
1 changed files with 8 additions and 4 deletions
|
@ -11,12 +11,16 @@ let
|
||||||
"videos"
|
"videos"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
home = config.home.homeDirectory;
|
||||||
|
|
||||||
defined = {
|
defined = {
|
||||||
"documents" = "${config.home.homeDirectory}/documents";
|
"documents" = "${home}/documents";
|
||||||
"download" = "${config.home.homeDirectory}/downloads";
|
"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
|
in
|
||||||
{
|
{
|
||||||
xdg = {
|
xdg = {
|
||||||
|
@ -24,6 +28,6 @@ in
|
||||||
userDirs = {
|
userDirs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
createDirectories = true;
|
createDirectories = true;
|
||||||
} // builtins.listToAttrs userDirs;
|
} // userDirs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue