Add libreoffice

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-31 20:55:05 +00:00
parent 26c1c797cd
commit 5e57d63a54
3 changed files with 47 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
{
username ? throw "username argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${username};
in
{
environment.persistence = {
"/persist".users.${username}.directories = [
"${hmConfig.xdg.relativeConfigHome}/libreoffice/4/user"
];
"/cache".users.${username}.directories = [
"${hmConfig.xdg.relativeConfigHome}/libreoffice/4/cache"
];
};
home-manager.users.${username} = {
home.packages = with pkgs; [
libreoffice-fresh
hunspell
hunspellDicts.en-us-large
hunspellDicts.el-gr
];
xdg.configFile."libreoffice/4/user/registrymodifications.xcu" = {
force = true;
text = ''
<?xml version="1.0" encoding="UTF-8"?>
<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="ShowTipOfTheDay" oor:op="fuse"><value>false</value></prop></item>
<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>
<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="ooSetupInstCompleted" oor:op="fuse"><value>true</value></prop></item>
<item oor:path="/org.openoffice.Setup/Product"><prop oor:name="ooSetupLastVersion" oor:op="fuse"><value>${lib.lists.last (lib.strings.splitString "/" pkgs.libreoffice-fresh.meta.changelog)}</value></prop></item>
<item oor:path="/org.openoffice.Setup/Product"><prop oor:name="LastTimeDonateShown" oor:op="fuse"><value>0</value></prop></item>
<item oor:path="/org.openoffice.Setup/Product"><prop oor:name="LastTimeGetInvolvedShown" oor:op="fuse"><value>0</value></prop></item>
'';
};
};
}