Cheatsheet

You can download the cheatsheet in PDF format here: cheatsheet.pdf

See the Pre-requisites and the Setting up the flake registry guide before getting started.

IOCs

For an introduction into IOC development, read Creating a StreamDevice IOC.

IOC creation

nix flake new -t epnix myTop

Create an EPNix EPICS top

makeBaseApp.pl -t ioc name

Initialize an EPICS app in an EPICS top

makeBaseApp.pl -a linux-x86_64 -i -t ioc -p name Name

Initialize an iocBoot folder in an EPICS top

IOC development

propagatedBuildInputs = [
  epnix.support.StreamDevice
];

In ioc.nix, add an EPICS support module to the build environment

nativeBuildInputs = [myLib];
buildInputs = [myLib];

In ioc.nix, add a native library to the build environment

myApp_DBD = stream.dbd
myApp_LIBS = stream

In myApp/src/Makefile, add an EPICS support module to an EPICS app

Important files

See Template files for more detailed information.

flake.nix

Nix project file

ioc.nix

Defines the EPICS top build

checks/simple.nix

Defines the simple integration check

IOC building

nix build -L

Build the IOC, showing compilation logs

nix develop

Enter the development shell

epicsConfigurePhase

In the development shell, configure the EPICS build

make

In the development shell, manually build the EPICS top

Flake input overrides

nix build -L \
  --override-input \
  supportModule \
  /path/to/supportModule

Build the IOC, but with a custom version of a support module

nix develop \
  --override-input \
  supportModule \
  /path/to/supportModule

Enter the development shell, but with a custom version of a support module

IOC testing

nix flake check -L

Run IOC checks

Adding integration tests to your IOC

IOC testing tutorial documentation

Testing

IOC testing guides

IOC inspection

For IOCs deployed on NixOS system by using the IOC services options.

systemctl status myIoc

Check whether an IOC is running

systemctl restart myIoc

Restart an IOC

systemctl stop myIoc

Stop an IOC

journalctl -xefu myIoc

Follow the logs of an IOC

telnet-myIoc

Connect to the command-line of an IOC

NixOS services

For an introduction into how to deploy EPICS-related services, read the Creating an Archiver Appliance instance tutorial.

Applying NixOS changes

nixos-rebuild test

Apply changes now, but revert them on reboot

nixos-rebuild switch

Apply changes now, and keep them on reboot

nixos-rebuild boot

Apply changes for the next reboot