Installing the Nix Package Manager

There isn’t really a reason to read my install directions for nix, I just used the default install command for Linux/Mac OS X.  To wit:

curl | sh

Except that I had to modify the .profile script to work in tcsh.  Namely, I created a version of the default file works for csh/tcsh:


if [ -n "$HOME" ]; then
  echo 'setenv NIX_LINK $HOME/.nix-profile;'

  # Set the default profile.
  if ! [ -L "$NIX_LINK" ]; then
    echo "creating $NIX_LINK" >&2
    /nix/store/rznhi2hyzcgckk7yb2662lr57sb906ps-coreutils-8.24/bin/ln -s "$_NIX_DEF_LINK" "$NIX_LINK"

  echo "setenv PATH ${NIX_LINK}/bin:${NIX_LINK}/sbin:$PATH;"
  # Subscribe the user to the Nixpkgs channel by default.
  if [ ! -e $HOME/.nix-channels ]; then
    echo " nixpkgs" > "$HOME/.nix-channels"

  # Append ~/.nix-defexpr/channels/nixpkgs to $NIX_PATH so that
  #  paths work when the user has fetched the Nixpkgs
  # channel.
  echo "setenv NIX_PATH ${NIX_PATH:+$NIX_PATH:}nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs;"

  # Set $SSL_CERT_FILE so that Nixpkgs applications like curl work.
  if [ -e /etc/ssl/certs/ca-certificates.crt ]; then # NixOS, Ubuntu, Debian, Gentoo, Arch
    echo 'setenv SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt;'
  elif [ -e /etc/ssl/certs/ca-bundle.crt ]; then # Old NixOS
    echo 'setenv SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt;'
  elif [ -e /etc/pki/tls/certs/ca-bundle.crt ]; then # Fedora, CentOS
    echo 'setenv SSL_CERT_FILE /etc/pki/tls/certs/ca-bundle.crt;'
  elif [ -e "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" ]; then # fall back to cacert in Nix profile
    echo 'setenv SSL_CERT_FILE "$NIX_LINK/etc/ssl/certs/ca-bundle.crt";'
  elif [ -e "$NIX_LINK/etc/ca-bundle.crt" ]; then # old cacert in Nix profile
    echo 'setenv SSL_CERT_FILE "$NIX_LINK/etc/ca-bundle.crt";'

I installed this file as: /nix/var/nix/profiles/default/etc/profile.d/nix.csh. Then I just called in my .tcshrc using:

eval `/nix/var/nix/profiles/default/etc/profile.d/nix.csh`

BasicTeX 2015

Ok, this is part of the regular series of these posts, and mostly serve as a simple record for my own use.  If there’s anyone out there reading this, please disregard yet another TeX upgrade  posting.

I know I’m going to have to do this again in a week or so when BasicTeX 2016 hits, but here it is anyway.  I should have done the normal tlmgr uninstall in step 1, but I noticed that I had a backlog of old TeX install directories out there, so I nuked them instead.  Partly this is because El Capitan broke the TeX link (/usr/texbin) and some GUI utils weren’t working (mainly the PrefPane).

  1. create a list of installed packages: tlmgr info --only-installed | cut -d: -f1 | cut -c3- > tex-packages
  2. rm -rf /usr/local/texlive
  3. download and install the current BasicTeX package from
  4. tlmgr update --self
  5. tlmgr update --all
  6. create a list of the packages installed by default: tlmgr info --only-installed | cut -d: -f1 | cut -c3- > tex-default
  7. Diff the two lists: diff tex-default tex-packages
  8. Install the packages using tlmgr
  9. tlmgr install algorithms collection-fontsrecommended enumitem endnotes exam footmisc lastpage multirow paralist parnotes subfigure tex4ht titles todonotes

BasicTeX 2013

Well that didn’t take long. Only 1 month after the release of BasicTeX 2013, I find myself in need of a new package. The TeXLive repository has already deprecated all of the 2012 pacakges, so I’m off and running installing BasicTeX 2013.

This year the steps are mostly the same, with the addition of more packages as I’m continuing my use of LaTeX apace.

  1. tlmgr uninstall
  2. download and install the current BasicTeX package from
  3. update PATH environment variable to include the current install location: /usr/local/texlive/2013basic/bin/universal-darwin
  4. tlmgr update --self
  5. tlmgr update --all
  6. tlmgr install collection-fontsrecommended
  7. tlmgr install subfigure
  8. tlmgr install exam
  9. tlmgr install algorithms
  10. tlmgr install lastpage
  11. tlmgr install paralist
  12. tlmgr install enumitem

You can find the documentation for algorithms, lastpage, and paralist on CTAN.

Avoiding Cisco AnyConnect on the Mac

I haven’t had much luck with Cisco VPN software on the Mac in the past.  Unfortunately, the Cisco AnyConnect software that we use at Towson doesn’t accept connections from the built-in Apple VPN client.

Luckily (and predictably), the open-source community has a solution to this problem.  OpenConnect is an open source replacement for AnyConnect.  It was a pretty easy install as these things go.  I use homebrew for packages on Mac OS X, so if you use something else your mileage may vary, but here’s the steps I used:

  1. brew install openconnect
  2. download and install TunTap virtual network drivers
  3. startup drivers manually, or reboot.
  4. test out your vpn connection.
In my case, I had a few other small things to do, I needed to extract and install the root certificate for Towson, and allow access to openconnect in /etc/sudoers.

For the record, uninstalling should be pretty simple, just:

  1. Re-edit /etc/sudoers
  2. delete the cert in ~/Library/Certificates
  3. brew uninstall openconnect
  4. rm  -r /Library/Extensions/tun.kext /Library/Extensions/tap.kext /Library/StartupItems/tun /Library/StartupItems/tap

BasicTeX 2012

I just upgraded to BasicTeX 2012, and here’s a quick synopsis of the steps:

  1. tlmgr uninstall
  2. download and install the current BasicTeX package from
  3. update PATH environment variable to include the current install location: /usr/local/texlive/2012basic/bin/universal-darwin
  4. tlmgr update --self
  5. tlmgr update --all
  6. tlmgr install collection-fontsrecommended
  7. tlmgr install subfigure
  8. tlmgr install exam

The Exam package is new (chalk it up to the new job), and the impetus for the updated install. The rest of the steps are really based on my previous TeX posts: here and here.

Uninstalling Java for OS X

Wouldn’t you know it, I install Oracle Java SE 7 for my Mac just days before a serious exploit is found in this newest version of Java. If you’re like me, it’s easier to just uninstall Java until Oracle has a chance to fix exploit. Here’s how:

Using the Terminal application (/Applications/Utilities/Terminal) enter the following commands one at a time:

sudo rm -rf /System/Library/Java/JavaVirtualMachines/*.jdk
sudo rm -rf /Library/Java/JavaVirtualMachines/*.jdk
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefpane

The first one should request an Administrator password, but the rest should run without it. You may encounter a “No such file or directory” error with some of these commands… no worries then, you just didn’t have that component installed.

Since I need a version of Java installed for development purposes and to use Photoshop CS4 (??), I went ahead and re-installed Apple’s supported version of Java SE 6. Java for OS X 2012-004 sounds like it requires a previous install of Java, but it seems to work fine with Mountain Lion (OS X 10.8.1) and no existing SE 6 install.

CS4 Service Manager complaining about JRE

I finally got around to installing Mountain Lion (OS X 10.8) this week. Most things seem to have gone smoothly, expect Adobe CS4 is now whining at after the initial boot. Specifically, I’m getting the following error:

To open "CS4Service Manager,", you need a Java SE 6 runtime...

Very annoying, especially since I think Adobe’s update systems are getting more and more invasive without giving significant benefits versus other applications I use.

Anyway, there’s a simple fix for the problem. Start up a terminal windows and type the following command:

launchctl unload -w /Library/LaunchAgents/com.adobe.CS4ServiceManager.plist

This prevents the CS4 Service Manager from launching automatically. I’m sure I’ll run into other problems with it in the future, but for the time being the pop-up dialog isn’t showing up anymore.