1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
Commit graph

64 commits

Author SHA1 Message Date
Michael Hoang
cf130aa957 users: don't generate ensurePerms when no users to manage 2024-11-07 17:20:00 +11:00
Michael Hoang
32814a6eb1 users: replace runtime check to prevent deleting root with assertion
This fixes SC2050 as `${name} == "root"` will be generated as a constant
expression.
2024-11-07 17:20:00 +11:00
Michael Hoang
041996803a treewide: fix shellcheck warnings and errors 2024-11-07 17:20:00 +11:00
Michael Hoang
318df382e6 users: don't check home directory is correct before creating user 2024-11-02 10:33:31 +11:00
Michael Hoang
f380194f3d users: create users with home directory /var/empty by default 2024-10-28 11:05:35 +11:00
Michael Hoang
c908607e8a users: remove users.forceRecreate option 2024-10-28 11:01:14 +11:00
Michael Hoang
a15a3d9f1f users: fix unclosed string 2024-10-28 10:51:09 +11:00
Michael Hoang
febc3b3f51 users: remove with lib; 2024-10-28 00:38:39 +11:00
Michael Hoang
32f0cf2140 users: replace FDA check with more fine grained permissions check 2024-10-28 00:38:39 +11:00
Michael Hoang
9cd3976486 users: ensure all users' home directories in the config are correct 2024-10-27 21:52:41 +11:00
Michael Hoang
55be3e1a5f users: move checks to system.checks 2024-10-27 21:52:41 +11:00
Michael Hoang
dc6f754fe5 users: allow shell to be managed by macOS 2024-10-27 21:52:41 +11:00
Michael Hoang
3712ff78cc users: change default shell to /usr/bin/false to match macOS 2024-10-27 21:26:19 +11:00
Michael Hoang
bd161d61d6 users: allow home to be managed by macOS 2024-10-27 21:26:19 +11:00
Michael Hoang
c9af5c2d13 users: update properties on known users 2024-10-27 21:26:19 +11:00
Emily
04193f188e
Merge pull request #1118 from Enzime/push-zvvxxryylwxt
users: ensure users' shells are installed
2024-10-24 09:05:00 +01:00
Michael Hoang
b089e7e726 users: switch back to using dscl for deleting users
The previous default behaviour when nix-darwin deletes users is that
their home directories are left intact, however as the `-keepHome` flag
for `sysadminctl -deleteUser` is broken, we'll need to switch back for
now.
2024-10-24 18:33:05 +11:00
Michael Hoang
b702750226 users: ensure Full Disk Access is granted before trying to create users 2024-10-24 14:33:16 +11:00
Michael Hoang
2be05de06e users: add missing newlines for FDA prompt 2024-10-24 14:33:02 +11:00
Michael Hoang
467a0d3d0c users: prevent deleting the user calling darwin-rebuild
`sysadminctl -deleteUser` will only prevent you from deleting the
current user if it's not the last admin and not the last secure token
user, otherwise it will happily oblige.
2024-10-24 14:33:02 +11:00
Michael Hoang
bbe1917238 users: ensure users' shells are installed 2024-10-24 14:18:31 +11:00
Michael Hoang
8c02940d70 users: ensure Full Disk Access is granted before trying to delete users 2024-10-23 01:29:01 +11:00
Michael Hoang
0a686597fa users: don't allow name to be empty 2024-10-22 22:54:04 +11:00
Michael Hoang
11c777c719 users: change default description to null 2024-10-22 22:54:04 +11:00
Michael Hoang
ac7932f9de users: use lib.escapeShellArg for group description 2024-10-22 19:43:18 +11:00
Michael Hoang
ea7e178ad4 users: use lib.escapeShellArg for createhomedir 2024-10-22 16:02:21 +11:00
Michael Hoang
8451125cf8 users: use lib.escapeShellArg for dscl paths 2024-10-22 16:02:21 +11:00
Michael Hoang
7bb6366f40 users: use lib.escapeShellArgs instead of custom version 2024-10-22 16:02:21 +11:00
Michael Hoang
26f7e45fb1 users: use lib.escapeShellArgs for sysadminctl -addUser 2024-10-22 16:02:21 +11:00
Michael Hoang
cb2e5fa6c5 users: use lib.escapeShellArg for sysadminctl -deleteUser 2024-10-22 16:02:21 +11:00
Michael Hoang
9a6b12b9ef users: use lib.escapeShellArg for id -u 2024-10-22 16:02:21 +11:00
Michael Hoang
5b873c48ac users: set default for users.users.<user>.name 2024-10-22 16:02:21 +11:00
Andrew Lubawy
2788e4fa98 Use sysadminctl instead of dscl
Co-authored-by: Michael Hoang <enzime@users.noreply.github.com>
2024-10-22 16:02:21 +11:00
Emily
97e0f72759 users: allow arbitrary group IDs
The upstream Nix UID/GID changes for Sequoia will require us to manage
a group with GID 350. That will require more work on our end to ensure
compatibility and a working migration path, but this is enough to
allow hacking around it locally in system configurations for now.
2024-09-05 10:39:01 +01:00
Weijia Wang
def1e23be8 treewide: remove lib.mdDoc 2024-04-19 04:05:50 +02:00
Michael Hoang
e7d7a7f0c5
Merge pull request #821 from qowoz/users
users: fix `forceRecreate` bash comparison
2024-03-04 16:25:51 +11:00
Hraban Luyat
f1d47fc2dd fix: set shell for new users, and only known ones 2024-01-20 11:03:15 -05:00
Hraban Luyat
888533c35f fix: user shell path handling
Properly detect the binary name (not just /nix/store/...-bash, but include the
.../bin/bash), and use the symlinked name which also appears in /etc/shells.
2024-01-20 11:03:15 -05:00
zowoq
0b638a97c0 users: fix forceRecreate bash comparison 2023-12-04 10:31:36 +10:00
Emily
e65131e69c treewide: convert all option docs to Markdown
This process was automated by [my fork of `nix-doc-munge`]; thanks
to @pennae for writing this tool! It automatically checks that the
resulting documentation doesn't change, although my fork loosens
this a little to ignore some irrelevant whitespace and typographical
differences.

As of this commit there is no DocBook remaining in the options
documentation.

You can play along at home if you want to reproduce this commit:

    $ NIX_PATH=nixpkgs=flake:nixpkgs/c1bca7fe84c646cfd4ebf3482c0e6317a0b13f22 \
      nix shell nixpkgs#coreutils \
      -c find . -name '*.nix' \
      -exec nix run github:emilazy/nix-doc-munge/0a7190f600027bf7baf6cb7139e4d69ac2f51062 \
      {} +

[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge
2023-06-24 10:48:55 +01:00
Malo Bourgon
7e74c1c9fb Move build user options to nix module to improve overlap with NixOS
Also add `config.ids` like in NixOS.
2022-08-16 10:41:51 -07:00
Daiderd Jordan
44da835ac4
add forward compatibility for literalExample deprecation
Fixes #367
2021-10-23 15:06:42 +02:00
Daiderd Jordan
5c3146b75d
users: migrate nixbld -> _nixbld
According to some investigation creating "role" accounts avoids
migration problems when upgrading to certain macOS versions, so create
the build users to match that definition and remove the old ones if
present.

    Role accounts require name starting with _ and UID in 200-400 range
2021-02-17 22:04:54 +01:00
Mario Rodas
a34dea283c Remove deprecated types.loaOf
types.loaOf has been deprecated for a long time and is now in the
process of removal. See: https://github.com/NixOS/nixpkgs/pull/96042
2020-09-02 04:20:00 +00:00
Daiderd Jordan
3d50598ae0
users: ensure uniqueness of gid/uid entries
Instead of a cryptic error during activation conflicting ids are now
caught during evaluation.

    error: The option `users.uids.30001' has conflicting definitions
2020-02-11 16:41:40 +01:00
Daiderd Jordan
267f50e63d
replace list values for types.loaOf
This type has been deprecated in nixpkgs, these options will be
replaced with types.attrsOf in the future.
2020-01-21 12:11:32 +01:00
Wael M. Nasreddine
41a00f14b4
users: gate the creation with an option, false by default and use createhomedir 2019-02-24 22:13:45 +01:00
Wael M. Nasreddine
7c68f69154
users: create/chown the home only when it is different than /var/empty 2019-02-24 22:06:45 +01:00
Wael M. Nasreddine
303c5fbb00
users: create the home-directory for a new user 2019-02-24 22:06:37 +01:00
Daiderd Jordan
6c6c8f2164
users.users: only extend profiles if packages are defined 2019-02-23 12:00:39 +01:00