User not created?

Hi, I have a weird case where a user is defined in the config, but not created on the system, when I activate said config:

nix-repl>  :stuck_out_tongue: nixosConfigurations.jenkins-main.config.users.users.jenkins
{
  autoSubUidGidRange = false;
  createHome = true;
  cryptHomeLuks = null;
  description = "jenkins user";
  enable = true;
  expires = null;
  extraGroups = [
    "docker"
    "qa"
  ];
  group = "jenkins";
  hashedPassword = null;
  hashedPasswordFile = null;
  home = "/var/lib/jenkins";
  homeMode = "700";
  ignoreShellProgramCheck = false;
  initialHashedPassword = null;
  initialPassword = null;
  isNormalUser = false;
  isSystemUser = false;
  linger = null;
  name = "jenkins";
  openssh = {
    authorizedKeys = {
      keyFiles = [ /nix/store/6i4w64l771fdanj0afma2nlda802wdyy-source/users/authorized_keys.txt ];
      keys = [ ];
    };
    authorizedPrincipals = [ ];
  };
  packages = [ ];
  pamMount = { };
  password = null;
  passwordFile = null;
  shell = «derivation /nix/store/l4gx345pnyaqndazyd4rlsf5igzv23nv-bash-interactive-5.3p9.drv»;
  subGidRanges = [ ];
  subUidRanges = [ ];
  uid = 996;
  useDefaultShell = true;
}

How do I debug that?

It seems like you have both users.users.jenkins.isNormalUser and users.users.jenkins.isSystemUser set to false. This is invalid. You probably want to set isSystemUser = true; here.

1 Like

Additionally, do you use sysusers (systemd.sysusers.enable) or userborn (services.userborn.enable)? This is not the default, but the way you can debug this depends on it. If both are false, users are created on activation time.

1 Like