This is the home-manager configuration I'm using on my laptop which runs Nixos 21.11. I use home-manager, you need to add it to your packages in your /etc/nixos/configuration.nix.
New polybar theme and shell config:
cd ~
git clone https://github.com/Micka-R/nixpkgs ./configs/nixpkgs
home-manager switch
-Translate my config.rasi to rofi.nix