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
(cherry picked from commit fceef469c2
)
This commit is contained in:
parent
318bc0754e
commit
4a8d628054
|
@ -89,16 +89,21 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
xdg.configFile."user-dirs.dirs".text = generators.toKeyValue { } ({
|
xdg.configFile."user-dirs.dirs".text = let
|
||||||
XDG_DESKTOP_DIR = cfg.desktop;
|
options = {
|
||||||
XDG_DOCUMENTS_DIR = cfg.documents;
|
XDG_DESKTOP_DIR = cfg.desktop;
|
||||||
XDG_DOWNLOAD_DIR = cfg.download;
|
XDG_DOCUMENTS_DIR = cfg.documents;
|
||||||
XDG_MUSIC_DIR = cfg.music;
|
XDG_DOWNLOAD_DIR = cfg.download;
|
||||||
XDG_PICTURES_DIR = cfg.pictures;
|
XDG_MUSIC_DIR = cfg.music;
|
||||||
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
XDG_PICTURES_DIR = cfg.pictures;
|
||||||
XDG_TEMPLATES_DIR = cfg.templates;
|
XDG_PUBLICSHARE_DIR = cfg.publicShare;
|
||||||
XDG_VIDEOS_DIR = cfg.videos;
|
XDG_TEMPLATES_DIR = cfg.templates;
|
||||||
} // cfg.extraConfig);
|
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";
|
xdg.configFile."user-dirs.conf".text = "enabled=False";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue