While this repository has example sources, it can also be used as a template to create an Agda project in Nix or NixOS. Just delete the examples
and attic
directoreis once you are sure the environment works as expected and then add your own sources.
nix-shell
from the current directory.
To launch emacs with agda-mode enabled, run mymacs
in the newly launched shell;
mymacs
will also load your ~/.emacs
file if it exists. If you are using
spacemacs, you will need to edit shell.nix
to use ~/.spacemacs
instead.
Examle: run mymacs examples/hello/hello-world.agda
then type C-c C-x C-c
in emacs
to compile the loaded hello world file.
Edit any of the nix expressions as needed. In particular:
- To add Agda dependencies via agda-pkg, edit
requirements.txt
- To add more Haskell or other system dependencies or other
target-language dependencies, edit
deps.nix
. - To add or alter the editor used, change the
myEmacs
references inshell.nix
or add similar derivations. - Optionally, create
.emacs_user_config
in the repository root directory and add any additional config, such as(setq agda2-backend "GHC")
to use GHC by default when compiling Agda files from emacs.