--- title: Declare accounts in users.users and software in the configuration; update by building a new generation area: users impact: CRITICAL tags: [users, groups, passwd, useradd, pkg, ips, updates, generations, solnix-rebuild, systemPackages, nix-profile] verified: 2026-11-04 --- # Declare accounts in users.users and software in the configuration; update by building a new generation On Solnix the configuration makes `/etc/passwd`, `/etc/shadow` and `/etc/group`, and every update is a new generation (a new boot environment). There is no `pkg`. Accounts made with `useradd` and updates done by hand are not in the configuration: a fresh install from it does not have them, and a declared user of the same name replaces them. **Antipattern** ```sh pfexec useradd -m -d /export/home/alice alice # only in this BE and the BEs cloned from it pfexec groupadd -g 1100 devs # the same: not in the configuration pfexec pkg install tmux; pfexec pkg update # no IPS and no pkg in the finished system pfexec solnix-rebuild switch --upgrade # --upgrade is accepted and ignored: it fetches nothing new users.users.alice.isNormalUser = true; # NixOS option; users.nix does not define it ``` **The Solnix way** ```nix users.groups.devs.gid = 1100; # gid has no default users.users.alice = { uid = 1001; # required unless isRoot extraGroups = [ "devs" ]; # primary group defaults to staff; home to /export/home/alice createHome = true; # default false: no home directory is made openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAA... alice" ]; # -> /etc/ssh/authorized_keys.d/alice }; # no hashedPassword: "NP", a password set with passwd(1) is kept environment.systemPackages = with pkgs.solnix; [ tmux ]; # system-wide software ``` ```sh grep RELEASE /etc/solnix-release # the branch this system's solnix flake follows: unstable, or a dated one such as 26.11 cd /etc/nixos && pfexec nix flake update solnix # if /etc/nixos is your configuration flake (else: where it lives) pfexec solnix-rebuild switch # builds the flake in /etc/nixos for #$(hostname); new generation = new BE solnix-N # accounts are written into the new BE: reboot into it, then pfexec passwd alice # once: kept by later generations because hashedPassword is null nix profile install solnix#tmux # just for you, no rebuild: lands in ~/.nix-profile/bin, on your PATH ``` users.nix: "The generated files land in the solnix /etc overlay (activation folds them in)". `switch` reconciles SMF live; the accounts are merged into the new BE (stock lines stay, declared users replace same-named lines), so they appear after you boot it. Find package names on search.solnix.io; only names the Solnix flake exports install. **The illumos way** (OpenIndiana, OmniOS, SmartOS) ```sh pfexec useradd -m -d /export/home/alice -G devs alice pfexec passwd alice # useradd(8): the new login stays locked until passwd(1) runs pfexec pkg install tmux # OpenIndiana: may also create a backup BE pfexec pkg update # OpenIndiana: updates every package; a new BE may be created ``` The live `/etc` files are the source of truth, and `pkg` changes the image in place or in a BE clone. **The difference.** Solnix replaces IPS: product.md maps "`pkg install` into a live `/`" to "immutable `/nix/store` + symlink farms" and "atomic upgrade + rollback" to "Nix generations ↔ ZFS boot environments". The IPS `user` and `group` actions are reimplemented as the users module. `useradd` and `passwd` still write the real files (they are copies, not store links). Undeclared lines are kept: install-be replaces only declared users and keeps the rest of the BE's own file, so a `useradd` account is carried into later generations cloned from that BE, but it is not in your configuration (a fresh install lacks it) and a BE older than the `useradd` does not have it. **Check.** After rebooting into the new BE, `getent passwd alice` prints `alice:x:1001:10::/export/home/alice:/usr/bin/ksh93`, and `beadm list` shows that `solnix-N` as `NR`. **Sources** - [.kiro/steering/product.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/.kiro/steering/product.md) (solnix 5a8e5ce), No IPS/`pkg` in the end product (IPS table; driver/user/group actions; bootstrap exception) - [modules/config/users.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/users.nix) (solnix 5a8e5ce), header; uid, group, home, shell, hashedPassword ("NP"), extraGroups, openssh.authorizedKeys.keys, createHome; groupType gid - [modules/system/activation/install-be.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/install-be.sh) (solnix 5a8e5ce), accounts merge ("stock lines stay"; NP keeps the BE's password) - [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce), configEtc; switch-to-configuration switch (activate, then do_boot with install-be); solnix-rebuild (`/etc/nixos/flake.nix`, `--upgrade` ignored) - [docs/nixos-parity-audit.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/docs/nixos-parity-audit.md) (solnix 5a8e5ce), row 2 Accounts; Managed /etc (passwd, shadow, group are real copies) - [modules/config/nix-channel.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/nix-channel.nix) (solnix 5a8e5ce), solnixFlake ref = the release, or `unstable`; `nix profile install solnix#` - [modules/config/release.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/release.nix) and [modules/config/edition.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/edition.nix) (solnix 5a8e5ce), /etc/solnix-release RELEASE= (the branch; EDITION= is a separate option that defaults to it) - [modules/config/system-path.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/system-path.nix) and [modules/config/shell-environment.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/shell-environment.nix) (solnix 5a8e5ce), environment.systemPackages; `nix profile install` puts the package on the user's PATH - [docs/install-x1.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/docs/install-x1.md) (solnix 5a8e5ce), §0 (`nix flake update solnix`) - [.kiro/steering/dev-environment.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/.kiro/steering/dev-environment.md) (solnix 5a8e5ce), Channel model (says `unstable` is the only channel for now; release.nix and nix-channel.nix already take a dated release) - [Handbook: Getting started](https://solnix.io/docs/handbook/getting-started#try-the-preview-image) (site 307b67f), preview image is the unstable edition - [Handbook: Learning Nix](https://solnix.io/docs/handbook/learning-nix#pkg--nix-command-by-command) (site 307b67f), `pkg` → Nix, command by command - [Handbook: Package search](https://solnix.io/docs/handbook/search#using-it) (site 307b67f), Using it (install forms; not installable yet) - [useradd(8)](https://solnix.io/docs/man/useradd.8) (illumos, CDDL), DESCRIPTION; [getent(8)](https://solnix.io/docs/man/getent.8), passwd database - [OpenIndiana handbook: Managing accounts](https://docs.openindiana.org/handbook/systems-administration/#managing-accounts); [Installing packages](https://docs.openindiana.org/handbook/getting-started/#installing-packages); [Updating packages](https://docs.openindiana.org/handbook/getting-started/#updating-packages)