Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

users: persistence (mutableUsers) #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

users: persistence (mutableUsers) #10

wants to merge 1 commit into from

Conversation

rehno-lindeque
Copy link
Owner

Persists user credentials.

Take note of the issue with using passwd which is explained in this thread NixOS/nixpkgs#3192

It appears that a solution is to use passwd with --root to chroot into the correct directory. (this is mentioned in the description for this option).

@rehno-lindeque
Copy link
Owner Author

It seems difficult to enable this option on a running system. Potentially it might be possible to do this when using nixos-install, but it's difficult after since nix needs /etc/passwd and /etc/shadow to activate.

nix-community/impermanence#88 may be required to make this work properly.

@rehno-lindeque
Copy link
Owner Author

rehno-lindeque commented May 26, 2022

Temporary workaround I tried for testing this in the mean time

mv /etc/passwd /persistent/passwd
mv /etc/shadow /persistent/shadow
ln -s /nix/persistent/etc/passwd /etc/passwd
ln -s /nix/persistent/etc/shadow /etc/shadow

Unfortunately this doesn't work because these files appear to be replaced while switching configurations (presumably by https://github.com/NixOS/nixpkgs/blob/e9bdd5fa74bcbae7d0b587bc4c12d2353fd92611/nixos/modules/config/update-users-groups.pl#L280-L310)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant