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

nixos/update-users-groups: add support for account expiry #246772

Merged
merged 3 commits into from
Aug 26, 2023

Conversation

r-vdp
Copy link
Contributor

@r-vdp r-vdp commented Aug 2, 2023

Description of changes

Complete #203792 by adding a NixOS test and fixing the perl script so that it also works for newly created users.

Original PR description:
Add users.users..expires. This allows giving temporary access to a user to a machine, and not have
to remember to remove it afterwards.

Ping: @zimbatm @RaitoBezarius

zimbatm and others added 3 commits November 30, 2022 21:09
Introduce a `users.users.<name>.expires` option to allows setting an
expiry date to user accounts.

This is useful when members should gain temporary access and you don't
want to have to roll out another system update to disable them.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Aug 2, 2023
@r-vdp
Copy link
Contributor Author

r-vdp commented Aug 2, 2023

@ofborg test user-expiry

@zimbatm
Copy link
Member

zimbatm commented Aug 2, 2023

thanks, looks good to go to me.

@figsoda figsoda added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Aug 9, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/1071

@fpletz fpletz merged commit da37904 into NixOS:master Aug 26, 2023
@r-vdp r-vdp deleted the nixos-user-expiry branch August 26, 2023 07:06
@lopsided98
Copy link
Contributor

This breaks cross-compiled NixOS because DateTime depends on Testutf8, which doesn't cross-compile, see: #198548

@RaitoBezarius
Copy link
Member

I will be going on holidays soon so apologies for not being able to deal with this, @lopsided98 how much realistic do you believe it is to fix the issue? Does it fail cross compilation on all targets or only armv7l?

@lopsided98
Copy link
Contributor

It should fail on all targets, since it has something to do with the use of miniperl when cross-compiling. Personally, I have observed the failure on armv5tel, armv6l and armv7l.

@Majiir
Copy link
Contributor

Majiir commented Aug 27, 2023

A commenter here reports it broken cross-compiling for aarch64 as well.

@r-vdp
Copy link
Contributor Author

r-vdp commented Aug 27, 2023

I think we can use Time::Piece instead which does cross compile and also offers the needed functions. It's also a smaller library.

I'll test this and make a PR.

Mic92 pushed a commit that referenced this pull request Sep 3, 2023
Since #246772, cross compiled NixOS is broken because the DateTime perl
package that was used in the update-users-groups.pl script depends on
Testutf8 which does not cross compile (see #198548).

This PR drops the DateTime dependency in favour of TimePiece, which has
less dependencies and whose closure does cross compile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants