This is an account of how I installed Idris on Guix System and a note to my future self should I ever forget the process. I was worried it would not gel well with the Guix philosophyTM but it worked out well enough without me having to create package definitions.
Background
Idris is a purely functional programming language with first class types[1] (Github, Website). Idris as used here refers to Idris2.
Pack is a package manager for Idris that comes with an installation of Idris (Github).
Guix System Distribution is a distribution of the GNU system which incorporates the Guix package manager and where the system configuration is declarative[3] (Website).
The Process
The high-level view of the installation process was to include $HOME/.local/bin in my system $PATH, open a guix shell with a manifest file containing all the build and runtime dependencies, run the installation command for Idris, and then include Chez Scheme in my guix config file since it is the default runtime dependency. Now the individual steps.
The first thing is to ensure that $HOME/.local/bin is in the system $PATH. I did this by modifying my guix home configuration file. Below is what my guix home configuration looked like afterwards(specifically under environment-variables):
(use-modules (gnu home)
(gnu packages)
(gnu services)
(guix gexp)
(gnu home services shells))
(home-environment
;; Below is the list of packages that will show up in your
;; Home profile, under ~/.guix-home/profile.
(packages (specifications->packages (list)))
;; Below is the list of Home services. To search for available
;; services, run 'guix home search KEYWORD' in a terminal.
(services
(append (list (service home-bash-service-type
(home-bash-configuration
(aliases '(("em" . "emacs -nw")
("ls" . "ls --color=auto")))
(environment-variables
`(("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; THIS IS WHAT YOU NEED TO ADD ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
("PATH" . "$PATH:$HOME/.local/bin")))
(bashrc (list (local-file
"$HOME/src/guix-config/.bashrc"
"bashrc")))
(bash-profile (list (local-file
"$HOME/src/guix-config/.bash_profile"
"bash_profile"))))))
%base-home-services)))
After this, run guix home reconfigure path/to/config/file to effect the changes made. Confirm that this has worked by reopening your terminal and looking for /$HOME/local/bin in the output of echo $PATH.
The next thing you'll need is a manifest file containing all that is required to build Idris. The following is a manifest file containing the build and runtime requirements:
;; idris2-manifest.scm
(specifications->manifest
(list
;; pack requirements
"git"
"chez-scheme"
"bash"
"make"
"gcc-toolchain"
"coreutils"
"gmp"
"curl"
"nss-certs"
"sed"
"findutils"))
On to creating a guix shell, where you'll run the build commands. Create a guix shell using the following command:
CC="gcc" guix shell --check -m idris2-manifest.scm
At this point, all requirements have been met and you can follow the installation guide here(https://github.com/stefan-hoeck/idris2-pack/blob/main/INSTALL.md).
The current install command is:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/stefan-hoeck/idris2-pack/main/install.bash)"
After the installation is complete, exit the shell by typing exit or Ctrl+D.
Conclusion
Eventually it would be nice to have a package definition that you can just guix install but for now, that's it! Idris is now installed and you can confirm it by running pack repl or idris2 in the terminal; any of these should drop you into an Idris repl.
1: https://github.com/idris-lang/Idris2
2: https://guix.gnu.org/manual/devel/en/html_node/
3: https://guix.gnu.org/manual/devel/en/html_node/GNU-Distribution.html
Top comments (0)