Oh-my-zsh for user

Hi all, I’ve this file for my user:

{ config, pkgs, ... }:


  users.enforceIdUniqueness = true;

  # Define a user account. Don't forget to set a password with passwd.
  users.extraUsers = {
    marco = {
      isNormalUser = true;
      uid = 1000;
      extraGroups = [ "wheel" "users" "networkmanager" ];
      shell = pkgs.zsh;


#  users.groups = [
#    { gid = 1000; name = "zar_marco"; }
#  ];
  programs.zsh.ohMyZsh = {
    enable = true;
    plugins = [ "git" "python" "man" ];
    theme = "agnoster";

Can I do set programs.zsh.ohMyZsh for one user and another programs.zsh.ohMyZsh for other user?

I had try to setted ohmyzsh via home-manager for my two normal users, and setted on root.nix on /etc/nixos for root. But with two normal users I’ve the themes overwritten, so on my normal user I see all two themes for zsh

marco@nixosgram /etc/nixos                                                                            [13:14:23]
 marco@nixosgram  /etc/nixos 

you can use home manager to configure ohmyzsh for each user (home-manager/modules/programs/zsh.nix at 1c43dcfac48a2d622797f7ab741670fdbcf8f609 · nix-community/home-manager · GitHub)

1 Like

Ok, so I must setting home-manager for root user too

I don’t know if this is a best practice but it could be worth a try.
Also you can use the nixos module for home manager to avoid having to make a new standalone home manager profile for the root user

1 Like

Now I’m try to enable home-manager standalone for root, I don’t know if home-manager standalone for users goes in collision with module for nixos. Thanks so much, with home-manager for user root I’ve what I want

 marco@nixosgram  ~  su -l saul
╭─saul@nixosgram ~ 
╰─$ su
root@nixosgram /home/saul                                                                          [14:20:50]
> #