I posted on Reddit but still have no answer, so I post it here to get more exposure
My goal: I want to overwrite cmigemo-dictionary
path
My method
Based on instructions from Configuring Emacs, I create a default.el
file and let Emacs automatically load it
Here’s my code
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> {};
unstable-pkgs = with pkgs; [
unstable.cmigemo
];
myNixEmacsConfig = pkgs.writeText "default.el" ''
(setq migemo-dictionary "${unstable.cmigemo}/share/migemo/utf-8")
'';
copyNixEmacsConfig = pkgs.runCommand "default.el" {} ''
mkdir -p $out/share/emacs/site-lisp
cp ${myNixEmacsConfig} $out/share/emacs/site-lisp/default.el
'';
myEmacs = pkgs.emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
copyNixEmacsConfig
]));
in
{
...
programs = {
emacs = {
enable = true;
package = myEmacs;
};
};
...
After running home-manager switch
, I see that default.el
is created at /nix/store/<hash>-default.el
with the following content (this is desirable)
(setq migemo-dictionary "/nix/store/5jjpxix76zd2zgj0w235ch39lyw6wc3y-cmigemo-1.3e/share/migemo/utf-8")
However, when I check the Emacs path with the following command, I don’t see any default.el
file
ls -ltra $(dirname $(dirname $(readlink -f $(which emacs))))/share/emacs/site-lisp
The output is
-r--r--r-- 1 root root 106 Jan 1 1970 subdirs.el
-r--r--r-- 1 root root 1746 Jan 1 1970 site-start.elc
-r--r--r-- 1 root root 2720 Jan 1 1970 site-start.el
dr-xr-xr-x 4 root root 4096 Jan 1 1970 ..
dr-xr-xr-x 2 root root 4096 Jan 1 1970 .
It looks like default.el
isn’t copied to this location
I don’t know what went wrong. Could you please help?