mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat[client]: automatically create emacs org files
This commit is contained in:
parent
47075799d6
commit
ad4443056a
4 changed files with 66 additions and 16 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{ self, lib, config, pkgs, globals, inputs, ... }:
|
||||
let
|
||||
inherit (config.swarselsystems) homeDir isPublic isNixos;
|
||||
inherit (config.swarselsystems) homeDir mainUser isPublic isNixos;
|
||||
inherit (config.repo.secrets.common.emacs) radicaleUser;
|
||||
in
|
||||
{
|
||||
|
|
@ -9,6 +9,31 @@ in
|
|||
# needed for elfeed
|
||||
# enable emacs overlay for bleeding edge features
|
||||
# also read init.el file and install use-package packages
|
||||
|
||||
home.activation.setupEmacsOrgFiles =
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
set -eu
|
||||
|
||||
if [ ! -d ${homeDir}/Org ]; then
|
||||
${pkgs.coreutils}/bin/install -d -m 0755 ${homeDir}/Org
|
||||
${pkgs.coreutils}/bin/chown ${mainUser}:syncthing ${homeDir}/Org
|
||||
fi
|
||||
|
||||
# create dummy files to make Emacs calendar work
|
||||
# these have low modified dates and should be marked as sync-conflicts
|
||||
for file in "Tasks" "Archive" "Journal"; do
|
||||
if [ ! -f ${homeDir}/Org/"$file".org ]; then
|
||||
${pkgs.coreutils}/bin/touch --time=access --time=modify -t 197001010000.00 ${homeDir}/Org/"$file".org
|
||||
${pkgs.coreutils}/bin/chown ${mainUser}:syncthing ${homeDir}/Org/"$file".org
|
||||
fi
|
||||
done
|
||||
|
||||
# when the configuration is build again, these sync-conflicts will be cleaned up
|
||||
for file in $(find ${homeDir}/Org/ -name "*sync-conflict*"); do
|
||||
${pkgs.coreutils}/bin/rm "$file"
|
||||
done
|
||||
'';
|
||||
|
||||
programs.emacs = {
|
||||
enable = true;
|
||||
package = pkgs.emacsWithPackagesFromUsePackage {
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@ in
|
|||
};
|
||||
};
|
||||
}) [
|
||||
"${serviceDir}/data"
|
||||
"${serviceDir}/data/cache"
|
||||
"${serviceDir}/data/locks"
|
||||
"${serviceDir}/data/log"
|
||||
"${serviceDir}/data/proxies"
|
||||
"data"
|
||||
"data/cache"
|
||||
"data/locks"
|
||||
"data/log"
|
||||
"data/proxies"
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ in
|
|||
};
|
||||
};
|
||||
}) [
|
||||
"${serviceDir}/var/data"
|
||||
"${serviceDir}/images"
|
||||
"var/data"
|
||||
"images"
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue