85 lines
2.2 KiB
Nix
85 lines
2.2 KiB
Nix
|
|
{
|
||
|
|
config,
|
||
|
|
lib,
|
||
|
|
...
|
||
|
|
}: {
|
||
|
|
u.bookmarks = let
|
||
|
|
home = config.home.homeDirectory;
|
||
|
|
in
|
||
|
|
lib.mkDefault [
|
||
|
|
{
|
||
|
|
href = "file://${home}";
|
||
|
|
name = "Home";
|
||
|
|
icon = "user-home";
|
||
|
|
}
|
||
|
|
{
|
||
|
|
href = "file://${home}/Desktop";
|
||
|
|
name = "Desktop";
|
||
|
|
icon = "user-desktop";
|
||
|
|
}
|
||
|
|
{
|
||
|
|
href = "file://${home}/Downloads";
|
||
|
|
name = "Downloads";
|
||
|
|
icon = "folder-downloads";
|
||
|
|
}
|
||
|
|
{
|
||
|
|
href = "file:///tmp";
|
||
|
|
name = "tmp";
|
||
|
|
icon = "folder-temp";
|
||
|
|
}
|
||
|
|
{
|
||
|
|
href = "trash:/";
|
||
|
|
name = "Trash";
|
||
|
|
icon = "user-trash";
|
||
|
|
}
|
||
|
|
{
|
||
|
|
href = "remote:/";
|
||
|
|
name = "Network";
|
||
|
|
icon = "folder-network";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
# dolphin complains if user-places.xbel is read-only
|
||
|
|
home.activation.user-places = let
|
||
|
|
path = "${config.xdg.dataHome}/user-places.xbel";
|
||
|
|
bookmarks =
|
||
|
|
lib.strings.concatMapStrings ({
|
||
|
|
href,
|
||
|
|
name,
|
||
|
|
icon,
|
||
|
|
}: ''
|
||
|
|
<bookmark href="${href}">
|
||
|
|
<title>${name}</title>
|
||
|
|
<info><metadata owner="http://freedesktop.org">
|
||
|
|
<bookmark:icon name="${icon}"/>
|
||
|
|
</metadata></info>
|
||
|
|
</bookmark>
|
||
|
|
'')
|
||
|
|
config.u.bookmarks;
|
||
|
|
file-content = ''
|
||
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE xbel>
|
||
|
|
<xbel>
|
||
|
|
<info>
|
||
|
|
<metadata>
|
||
|
|
<kde_places_version>4</kde_places_version>
|
||
|
|
<GroupState-Places-IsHidden>false</GroupState-Places-IsHidden>
|
||
|
|
<GroupState-Remote-IsHidden>false</GroupState-Remote-IsHidden>
|
||
|
|
<GroupState-Devices-IsHidden>false</GroupState-Devices-IsHidden>
|
||
|
|
<GroupState-RemovableDevices-IsHidden>false</GroupState-RemovableDevices-IsHidden>
|
||
|
|
<GroupState-Tags-IsHidden>false</GroupState-Tags-IsHidden>
|
||
|
|
<withBaloo>true</withBaloo>
|
||
|
|
<GroupState-SearchFor-IsHidden>false</GroupState-SearchFor-IsHidden>
|
||
|
|
<GroupState-RecentlySaved-IsHidden>false</GroupState-RecentlySaved-IsHidden>
|
||
|
|
</metadata>
|
||
|
|
</info>
|
||
|
|
${bookmarks}
|
||
|
|
</xbel>
|
||
|
|
'';
|
||
|
|
in
|
||
|
|
lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||
|
|
[ ! -e "${path}" ] && cat > "${path}" <<EOF
|
||
|
|
${file-content}
|
||
|
|
EOF
|
||
|
|
'';
|
||
|
|
}
|