Darwin-rebuild not applying home manager bash settings

When I run darwin-rebuild switch --flake my home-manager bash settings aren’t applied to my ~/.bashrc, and I am dumped into /bin/bash, not my user shell.

I have tried running /etc/profiles/per-user/holdenc/bin/bash, and source ~/.bashrc, neither result in my expected shell.

When I installed Darwin I used sudo, because I was running into permission issues. I wonder if that might be causing the issue.

I have the following settings in my configuration.nix:

 # A list of permissable shells for login accounts
  environment.shells = [ pkgs.bashInteractive ];
  # enable bash as an interactive shell 
  programs.bash.enable = true;
  # the users's default shell
  users.knownUsers = [ "holdenc" ];
  users.users.archie = {
    home = "/Users/holdenc";
    shell = pkgs.bashInteractive;
    uid = 501;
  };

Can anyone provide with me with any debugging steps I can try?
Tried nix-collect-garbage -d, rm -rf ~/.cache/nix.

For what it’s worth my configuration works fine on NixOS, and has worked fine on Darwin until recently.

I’m not familiar with mac so I’ll leave others to answer, but I have a comment:

This is not a troubleshooting step, unless you like longer rebuilds with no upsides.

This is the flake evaluation cache, and this would only help if eval was somehow broken.

WHere have you set home.programs.bash.enable ? Your config shows nix-darwin set up but no home manager settings, the latter are the ones that affect the files in your home directory.

As for why /bin/bash - I think you have to set your shell in System Settings manually - or set in in your terminal app.

I’ve set programs.bash.enable in my home manager module.

As for why /bin/bash - I think you have to set your shell in System Settings manually - or set in in your terminal app.

Yes, the issue is that my shell settings don’t appear in my .bashrc, so even if I source my user shell, nothing changes.

I think you missed this

Turns out this was the issue. Deleting and reinstalling nix / Darwin without sudo resolved this.