The Complete Computing Environment

Creating Soft Link Activation Scripts for Home Manager

LifeTechEmacsTopicsArcology

This is a simple CCE home-manager helper. It's used to create softlinks to files/directories/etc that aren't managed by home-manager. Configuration directories kept in sync through Syncthing are a simple example here, but it's also used to inject "secret" files like my password-store.

{}:
config: src: dest:

config.lib.dag.entryAfter ["writeBoundary"] ''
  $DRY_RUN_CMD test -e $HOME/${dest} || \
  $DRY_RUN_CMD ln -s $VERBOSE_ARG \
  ${src} $HOME/${dest}
''

use it like:

mkActivationLocalLink = import lib/mk_activation_local_link.nix {};
mkActivationLocalLink config src dest

or

mkActivationLocalLink = import lib/mk_activation_local_link.nix {};
mkActivationLocalLink config "${pkgs.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/bin/cpptools" "/home/tor/tmp/cpptools"

or if you have Arroyo Nix Support

pkgs.lib.mkActivationLocalLink config "${pkgs.vscode-extensions.ms-vscode.cpptools}/share/vscode/extensions/ms-vscode.cpptools/bin/cpptools" "/home/tor/tmp/cpptools"