diff options
author | jD91mZM2 <me@krake.one> | 2020-08-12 22:51:20 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-08-13 00:07:04 +0200 |
commit | fceef469c2ec99232d847f1d9d6b32665d915bbb (patch) | |
tree | f73c1be8065cdd5830f7c0f0b0f28a2ca359ea65 /modules | |
parent | ae8f432a759d42b03ade24f01ed7466869cbbf90 (diff) |
xdg-user-dirs: fix erroneous dirs file
Before this change,
```rust
fn main() {
println!("{:?}", glib::get_user_special_dir(glib::UserDirectory::Documents));
}
```
would return `None` even though `~/Documents` is available and
`xdg.userDirs.enable = true`. Checking the differences between
`xdg-user-dirs-update` shows that the latter has quotes around each
thing.
PR #1440
Diffstat (limited to 'modules')
-rw-r--r-- | modules/misc/xdg-user-dirs.nix | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/modules/misc/xdg-user-dirs.nix b/modules/misc/xdg-user-dirs.nix index 854eaf83026..a1db6b115a1 100644 --- a/modules/misc/xdg-user-dirs.nix +++ b/modules/misc/xdg-user-dirs.nix @@ -89,16 +89,21 @@ in { }; config = mkIf cfg.enable { - xdg.configFile."user-dirs.dirs".text = generators.toKeyValue { } ({ - XDG_DESKTOP_DIR = cfg.desktop; - XDG_DOCUMENTS_DIR = cfg.documents; - XDG_DOWNLOAD_DIR = cfg.download; - XDG_MUSIC_DIR = cfg.music; - XDG_PICTURES_DIR = cfg.pictures; - XDG_PUBLICSHARE_DIR = cfg.publicShare; - XDG_TEMPLATES_DIR = cfg.templates; - XDG_VIDEOS_DIR = cfg.videos; - } // cfg.extraConfig); + xdg.configFile."user-dirs.dirs".text = let + options = { + XDG_DESKTOP_DIR = cfg.desktop; + XDG_DOCUMENTS_DIR = cfg.documents; + XDG_DOWNLOAD_DIR = cfg.download; + XDG_MUSIC_DIR = cfg.music; + XDG_PICTURES_DIR = cfg.pictures; + XDG_PUBLICSHARE_DIR = cfg.publicShare; + XDG_TEMPLATES_DIR = cfg.templates; + XDG_VIDEOS_DIR = cfg.videos; + } // cfg.extraConfig; + + # For some reason, these need to be wrapped with quotes to be valid. + wrapped = mapAttrs (_: value: ''"${value}"'') options; + in generators.toKeyValue { } wrapped; xdg.configFile."user-dirs.conf".text = "enabled=False"; }; |