The goal of this project is to create a way to manage Mikrotik RouterOS routers using nix.
I’m not an expert with nix and I have no idea about how to go about creating a new nix project from scratch, so this project is a learning project.
Very happy to have people get involved in this, Ideas / suggestions / PRs are welcome! You can reach me through github issues / PRs or on email [email protected].
The usage of this project currently is very basic and something to be improved.
git clone https://github.com/Plommonsorbet/nix-mikrotik
cd nix-mikrotik
nix-build mikrotik.nix
nix-build mikrotik.nix --arg mikrotik-config ./my-config.nix
This is to be able to parse default router config for your router model or your current configuration setup as a starting point when migrating.
Build a tool for deploying this configuration to devices similar to nixops or morph.
Create a diff tool to compare a test build with the active device config.
In the meanwhile a dirty script to just pull the build config and export the config from a device and run the binary diff would be a start. But I want to have to eventually build a system that is a bit smarter and can compare each configuration object. However this would need a parser before it can be done.
Some kind of testing that it works. This could be done against a vm running specific versions of RouterOS.
The config that is generated should be verified with assertions and network relevant types to minimize the risk of a bad config being generated.
This is especially important since routers are so essential and a small mistake could be catastrophic.