You can use nix, the package manager, to install system wide packages on all operating systems which support nix and are supported by a given package. Don‘t forget that you also get nix-shell for temporary environments and portable scripts. With home-manager, an independent software package working with nix, you get the additional ability to manage user environments declaratively through nix, with configuration modules, rollbacks and what not. OS compatibility for a given package is obviously a requirement here, too.
However, you cannot use features from NixOS, the Linux distribution relying on nix for self-configuration, anywhere else than NixOS. These include system services and OS-level declarative, modular configuration. For macOS/Darwin there exists nix-darwin, which can control some significant amount of system properties.