summaryrefslogtreecommitdiffstats
path: root/nixos/modules/config/users-groups.nix
AgeCommit message (Collapse)Author
2018-12-15lib.makePerlPath -> perlPackages.makePerlPathvolth
2018-10-24nixos/users: fix users home directory with isNormalUserJeff Slight
2018-08-25systemd: added groups kvm, renderEric Wolf
they need to exist according to the README of systemd
2018-07-23fix build with allowAliases=falsevolth
2018-07-20[bot] nixos/*: remove unused arguments in lambdasvolth
2018-04-08Increase max group name length to 32 charactersaszlig
With #36556, a check was introduced to make sure the user and group names do not exceed their respective maximum length. This is in part because systemd also enforces that length, but only at runtime. So in general it's a good idea to catch as much as we can during evaluation time, however the maximum length of the group name was set to 16 characters according groupadd(8). The maximum length of the group names however is a compile-time option and even systemd allows more than 16 characters. In the mentioned pull request (#36556) there was already a report that this has broken evaluation for people out there. I have also checked what other distributions are doing and they set the length to either 31 characters or 32 characters, the latter being more common. Unfortunately there is a difference between the maximum length enforced by the shadow package and systemd, both for user name lengths and group name lengths. However, systemd enforces both length to have a maximum of 31 characters and I'm not sure if this is intended or just a off-by-one error in systemd. Nevertheless, I choose 32 characters simply to bring it in par with the maximum user name length. For the NixOS assertion however, I use a maximum length of 31 to make sure that nobody accidentally creates services that contain group names that systemd considers invalid because of a length of 32 characters. Signed-off-by: aszlig <aszlig@nix.build> Closes: #38548 Cc: @vcunat, @fpletz, @qknight
2018-04-05Merge pull request #38111 from oxij/tree/cleanupsMichael Raskin
assorted cleanups
2018-03-30user/group assertion to not exceed the 32 character limitJoachim Schiele
2018-03-30nixos: users-groups: cleanupJan Malakhovski
2018-02-27Create /home with the right permissionsEelco Dolstra
Without this, it will be created with 700 permissions.
2018-02-05Move creation of /root to the activation scriptEelco Dolstra
...so it appears in a new installation before rebooting the system.
2017-11-05users-groups module: use `buildEnv` in per-user profilesMichal Rus
Resolves #31253
2017-07-29environment.etc: add user/group optionVolth
fixes #27546
2017-05-12users-groups module: add per-user packagestv
2016-09-13users-groups module: optionSet -> submoduleEric Sagnes
2016-06-25modules/users-groups: add shell exampleProfpatsch
2016-06-19Merge pull request #16189 from zimbatm/usershell-configzimbatm
User shell config
2016-06-14nixos: remove the grsecurity GIDJoachim Fasting
This GID was used to exempt users from Grsecurity's `/proc` restrictions; we now prefer to rely on `security.hideProcessInformation`, which uses the `proc` group for this purpose. That leaves no use for the grsecurity GID. More generally, having only a single GID to, presumably, serve as the default for all of grsecurity's GID based exemption/resriction schemes would be problematic in any event, so if we decide to enable those grsecurity features in the future, more specific GIDs should be added.
2016-06-12Use shell packages to select the user's shellzimbatm
The string type is still available for backward-compatiblity.
2016-01-02Fix package name typoJacob Mitchell
2015-10-14Factor out option renamingEelco Dolstra
Option aliases/deprecations can now be declared in any NixOS module, not just in nixos/modules/rename.nix. This is more modular (since it allows for example grub-related aliases to be declared in the grub module), and allows aliases outside of NixOS (e.g. in NixOps modules). The syntax is a bit funky. Ideally we'd have something like: options = { foo.bar.newOption = mkOption { ... }; foo.bar.oldOption = mkAliasOption [ "foo" "bar" "newOption" ]; }; but that's not possible because options cannot define values in *other* options - you need to have a "config" for that. So instead we have functions that return a *module*: mkRemovedOptionModule, mkRenamedOptionModule and mkAliasOptionModule. These can be used via "imports", e.g. imports = [ (mkAliasOptionModule [ "foo" "bar" "oldOption" ] [ "foo" "bar" "newOption" ]); ]; As an added bonus, deprecation warnings now show the file name of the offending module. Fixes #10385.
2015-09-02Rename users.extraUsers -> users.users, users.extraGroup -> users.groupsEelco Dolstra
The "extra" part hasn't made sense for years.
2015-09-02If !cfg.mutableUsers, require a password or SSH authorized keyEelco Dolstra
Fixes https://github.com/NixOS/nixpkgs/issues/7308
2015-07-04pam_mount module: integrate pam_mount into PAM of NixOSThomas Strobel
2015-04-01Fix references to current-system/sw/sbinWilliam A. Kennington III
2015-03-03Add "input" groupEelco Dolstra
This is required by systemd >= 215.
2015-01-03fix manualDomen Kožar
2015-01-02clarify things about hashed passwords and mutableUsersDomen Kožar
2014-11-03Obsolete security.initialPasswordEelco Dolstra
You can now set users.extraUsers.root.initialHashedPassword instead.
2014-11-03Handle initialPassword and initialHashedPassword for !mutableUsersEelco Dolstra
In this case, they're equivalent to setting ‘password’ and ‘hashedPassword’ (since there is no distinction between an initial and non-initial user account state).
2014-11-03Add initialPassword and initialHashedPassword optionsEelco Dolstra
These are like password and hashedPassword, except that they only apply when the user is initially created.
2014-10-23passwordFile: update descriptionLongrin Wischnewski
2014-09-22nixos: Add also group.members to groupRickard Nilsson
2014-09-10Support users-groups.json referring to store pathsEelco Dolstra
Fixes #4016.
2014-09-05Fix subuid/subgid generationEelco Dolstra
I don't think we need to filter users with an unset uid, because mkSubuidEntry/mkSubgidEntry don't references the uid.
2014-08-30Merge recent master into stagingVladimír Čunát
Hydra: ?compare=1149952 Conflicts: nixos/doc/manual/configuration.xml (changed split file) nixos/modules/config/users-groups.nix (choosing filterNull instead of inline definition) pkgs/development/libraries/readline/readline6.3.nix (auto-solved)
2014-08-29nixos/users-groups: Fix eval on missing uid/gid.aszlig
This hopefully fixes a regression introduced by 08b214a. In bf129a2, it was already fixed for normal uid/gid values and it got reintroduced by sub-uid/gid-handling again, so I've refactored it a bit into a filterNull function which takes care of also the filtering introduced by bf129a2. I have not tested this extensively, but master is already broken for systems with `mutableUsers = true` and no uid values set. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-08-29Merge pull request #3100 from tailhook/new-shadowMichael Raskin
Upgrade "shadow" to 4.2.1
2014-08-21Merge recent master into stagingVladimír Čunát
Hydra: ?compare=1148749 Conflicts (easy): nixos/modules/virtualisation/containers.nix
2014-08-20use mkDefault on root's shellMatej Cotman
2014-08-15Add user attribute isNormalUserEelco Dolstra
This is shorthand for setting group, createHome, home, useDefaultShell and isSystemUser.
2014-08-15Unify mutableUsers = { true, false }Eelco Dolstra
With mutableUsers = true, we now ensure that all users and groups that were created declaratively, are updated or removed appropriately. Thus, adding a user to users.extraUsers and then removing it now causes the acoount to be removed from /etc/passwd. Thus user/group management is fully congruent except that users and groups that were created imperatively (via useradd/groupadd) are not touched. We distinguish between declarative and imperative users/groups by tracking the former in /var/lib/nixos/declarative-{groups,users}. With mutableUsers = false, you are now no longer required to specify UIDs/GIDs for all users. The handling of mutableUsers = true/false is the same code path; the only difference is that the "false" mode ignores the existing contents of /etc/{passwd,group}. The attribute ‘createUser’ is gone. It doesn't really make sense to specify users that shouldn't be created.
2014-08-01First implementation of subuid/subgid manipulation modulePaul Colomiets
2014-05-28better error message in case of missing uidsSönke Hahn
2014-05-17fix -G delimiter in call to useraddCharles Strahan
2014-05-09nixos-install: Ask the user to set a root passwordEelco Dolstra
This removes the need to have an initially empty root password.
2014-05-05Fix users.*.extraGroups for users.mutableUsers = true.Rob Vermaas
(cherry picked from commit eb222923054fdc895ab73ff5d0260c1e1fc689c7)
2014-04-29Bring back the isSystemUser optionEelco Dolstra
2014-04-14Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra
Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
2014-04-11nixos: add grsecurity module (#1875)Austin Seipp
This module implements a significant refactoring in grsecurity configuration for NixOS, making it far more usable by default and much easier to configure. - New security.grsecurity NixOS attributes. - All grsec kernels supported - Allows default 'auto' grsec configuration, or custom config - Supports custom kernel options through kernelExtraConfig - Defaults to high-security - user must choose kernel, server/desktop mode, and any virtualisation software. That's all. - kptr_restrict is fixed under grsecurity (it's unwriteable) - grsecurity patch creation is now significantly abstracted - only need revision, version, and SHA1 - kernel version requirements are asserted for sanity - built kernels can have the uname specify the exact grsec version for development or bug reports. Off by default (requires `security.grsecurity.config.verboseVersion = true;`) - grsecurity sysctl support - By default, disabled. - For people who enable it, NixOS deploys a 'grsec-lock' systemd service which runs at startup. You are expected to configure sysctl through NixOS like you regularly would, which will occur before the service is started. As a result, changing sysctl settings requires a reboot. - New default group: 'grsecurity' - Root is a member by default - GRKERNSEC_PROC_GID is implicitly set to the 'grsecurity' GID, making it possible to easily add users to this group for /proc access - AppArmor is now automatically enabled where it wasn't before, despite implying features.apparmor = true The most trivial example of enabling grsecurity in your kernel is by specifying: security.grsecurity.enable = true; security.grsecurity.testing = true; # testing 3.13 kernel security.grsecurity.config.system = "desktop"; # or "server" This specifies absolutely no virtualisation support. In general, you probably at least want KVM host support, which is a little more work. So: security.grsecurity.enable = true; security.grsecurity.stable = true; # enable stable 3.2 kernel security.grsecurity.config = { system = "server"; priority = "security"; virtualisationConfig = "host"; virtualisationSoftware = "kvm"; hardwareVirtualisation = true; } This module has primarily been tested on Hetzner EX40 & VQ7 servers using NixOps. Signed-off-by: Austin Seipp <aseipp@pobox.com>