summary refs log tree commit diff
path: root/nixos/modules/config
Commit message (Collapse)AuthorAge
* Start ssh-agent as a user unitEelco Dolstra2014-04-18
| | | | | | | | | | | | | | | | | | This has some advantages: * You get ssh-agent regardless of how you logged in. Previously it was only started for X11 sessions. * All sessions of a user share the same agent. So if you added a key on tty1, it will also be available on tty2. * Systemd will restart ssh-agent if it dies. * $SSH_AUTH_SOCK now points to the /run/user/<uid> directory, which is more secure than /tmp. For bonus points, we should patch ssh-agent to support socket-based activation...
* Allow upstream systemd units to be extendedEelco Dolstra2014-04-17
| | | | | | | | | | | | If you define a unit, and either systemd or a package in systemd.packages already provides that unit, then we now generate a file /etc/systemd/system/<unit>.d/overrides.conf. This makes it possible to use upstream units, while allowing them to be customised from the NixOS configuration. For instance, the module nix-daemon.nix now uses the units provided by the Nix package. And all unit definitions that duplicated upstream systemd units are finally gone. This makes the baseUnit option unnecessary, so I've removed it.
* no-x-libs.nix: Disable su xauth forwarding, and X11 dependency in dbusEelco Dolstra2014-04-16
|
* cpu-freq: Use cpupower instead of cpufrequtilsWilliam A. Kennington III2014-04-16
| | | | | | Additionally, put the powersave utility in charge of loading the cpufrequency modules based on the governor specified in the configuration.
* Rewrite ‘with pkgs.lib’ -> ‘with lib’Eelco Dolstra2014-04-14
| | | | | | | | 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.
* nixos: add grsecurity module (#1875)Austin Seipp2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Don't add users if createUser is falseRickard Nilsson2014-04-08
|
* Allow undefined uids and gids when mutableUsers = trueRickard Nilsson2014-04-06
| | | | | | | | Groups and users without gid/uid are created with useradd/groupadd after the passwd/group merge phase if mutableUsers = true. This should fix #2114.
* su: Make the su package a provider of only the su binaryWilliam A. Kennington III2014-04-05
| | | | | Additionally, provide su with the base system and remove su from the util-linux package as it is now provided by shadow.
* power-management: Don't enable acpid.ambrop7@gmail.com2014-03-15
| | | | Running acpid along with systemd will cause double handling of acpi events.
* Merge pull request #1767 from the-kenny/fix-consoleKeyMap-typeDomen Kožar2014-03-08
|\ | | | | i18n.consoleKeyMap: Accept string or path.
| * i18n.consoleKeyMap: Accept string or path.Moritz Ulrich2014-02-17
| | | | | | | | | | | | | | | | | | | | i18n.consoleKeyMap maps to KEYMAP=... in vconsole.conf and `loadkeymap' in stage1. Both of these accept paths to a keymap file in addition to a string containing the name of the keymap. With this commit, it's possible to use your own keymap via: i18n.consoleKeyMap = ./path/to/something.kmap
* | nixos: set all package options to have type packageDomen Kožar2014-02-27
|/
* Allow directly setting hashedPassword for rootShea Levy2014-02-16
|
* user-groups: Sidestep all password escaping issuesShea Levy2014-02-10
| | | | Now passwords are written to a file first
* Properly escape passwords sent to chpasswdThomas Tuegel2014-02-10
| | | | | | | | | The mutableUsers feature uses `chpasswd` to set users passwords. Passwords and their hashes were being piped into the program using double quotes ("") to escape. This causes any `$` characters to be expanded as shell variables. This is a serious problem because all the password hash methods besides DES use multiple `$` in the hashes. Single quotes ('') should be used instead to prevent shell variable expansion.
* Add option to enforce uniqueness of uids/gids (on by default)Shea Levy2014-02-07
| | | | Signed-off-by: Shea Levy <shea@shealevy.com>
* Add description to group.members optionRickard Nilsson2014-02-05
|
* Re-introduce security.initialRootPassword, and add a new option ↵Rickard Nilsson2014-02-05
| | | | users.extraUsers.<user>.hashedPassword
* Generate /etc/passwd and /etc/group at build timeRickard Nilsson2014-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rather large commit that switches user/group creation from using useradd/groupadd on activation to just generating the contents of /etc/passwd and /etc/group, and then on activation merging the generated files with the files that exist in the system. This makes the user activation process much cleaner, in my opinion. The users.extraUsers.<user>.uid and users.extraGroups.<group>.gid must all be properly defined (if <user>.createUser is true, which it is by default). My pull request adds a lot of uids/gids to config.ids to solve this problem for existing nixos services, but there might be configurations that break because this change. However, this will be discovered during the build. Option changes introduced by this commit: * Remove the options <user>.isSystemUser and <user>.isAlias since they don't make sense when generating /etc/passwd statically. * Add <group>.members as a complement to <user>.extraGroups. * Add <user>.passwordFile for setting a user's password from an encrypted (shadow-style) file. * Add users.mutableUsers which is true by default. This means you can keep managing your users as previously, by using useradd/groupadd manually. This is accomplished by merging the generated passwd/group file with the existing files in /etc on system activation. The merging of the files is simplistic. It just looks at the user/group names. If a user/group exists both on the system and in the generated files, the system entry will be kept un-changed and the generated entries will be ignored. The merging itself is performed with the help of vipw/vigr to properly lock the account files during edit. If mutableUsers is set to false, the generated passwd and group files will not be merged with the system files on activation. Instead they will simply replace the system files, and overwrite any changes done on the running system. The same logic holds for user password, if the <user>.password or <user>.passwordFile options are used. If mutableUsers is false, password will simply be replaced on activation. If true, the initial user passwords will be set according to the configuration, but existing passwords will not be touched. I have tested this on a couple of different systems and it seems to work fine so far. If you think this is a good idea, please test it. This way of adding local users has been discussed in issue #103 (and this commit solves that issue).
* Don't set $TZEelco Dolstra2014-01-06
| | | | | | | Now that Java is happy with our /etc/localtime, there is no reason to set $TZ anymore. (See 945849b86fe33474da569b307d7e5880877491b6, 279248f6c562eb88227d22b824c9324683980b96, 1b5e860f65607b4cc7de4b6b5db95460cf144526.) Fixes #1463.
* Make /etc/localtime a direct symlink to the zoneinfo fileEelco Dolstra2014-01-06
| | | | | | | Some programs (notably the Java Runtime Environment) expect to be able to extract the name of the time zone from the target of the /etc/localtime symlink. That doesn't work if /etc/localtime is a symlink to /etc/static/localtime. So make it a direct symlink.
* Disable various services when running inside a containerEelco Dolstra2013-11-26
|
* Add some primops to libEelco Dolstra2013-11-12
|
* nixos: capitalize a bunch of service descriptionsBjørn Forsman2013-11-09
| | | | | | | | | | | | (systemd service descriptions that is, not service descriptions in "man configuration.nix".) Capitalizing each word in the description seems to be the accepted standard. Also shorten these descriptions: * "Munin node, the agent process" => "Munin Node" * "Planet Venus, an awesome ‘river of news’ feed reader" => "Planet Venus Feed Reader"
* Print a reminder to users to set or disable the root passwordEelco Dolstra2013-11-01
|
* Don't set an initial null root password for Amazon / VirtualBox imagesEelco Dolstra2013-11-01
| | | | | | | | | A null password allows logging into local PAM services such as "login" (agetty) and KDM. That's not actually a security problem for EC2 machines, since they do not have "local" logins; for VirtualBox machines, if you local access, you can do anything anyway. But it's better to be on the safe side and disable password-based logins for root.
* Improve description of the users.extraUsers.*.description optionEelco Dolstra2013-10-31
| | | | Fixes NixOS/nixos#278.
* Make update-mime-database less verboseEelco Dolstra2013-10-30
|
* Add lots of missing option typesEelco Dolstra2013-10-30
|
* Strictly check the arguments to mkOptionEelco Dolstra2013-10-30
| | | | And fix various instances of bad arguments.
* Show correct position info for errors in submodulesEelco Dolstra2013-10-30
| | | | | | | | E.g. The unique option `fileSystems./.device' is defined multiple times, in `/etc/nixos/configuration.nix' and `/etc/nixos/foo.nix'. This requires passing file/value tuples to the merge functions.
* Add some option typesEelco Dolstra2013-10-30
|
* Substitute "types.uniq types.string" -> "types.str"Eelco Dolstra2013-10-30
|
* Show precise error messages in option merge failuresEelco Dolstra2013-10-28
| | | | | | | | | | | | | | For instance, if time.timeZone is defined multiple times, you now get the error message: error: user-thrown exception: The unique option `time.timeZone' is defined multiple times, in `/etc/nixos/configurations/misc/eelco/x11vnc.nix' and `/etc/nixos/configuration.nix'. while previously you got: error: user-thrown exception: Multiple definitions of string. Only one is allowed for this option. and only an inspection of the stack trace gave a clue as to what option caused the problem.
* Fix evaluation of environment.variablesEelco Dolstra2013-10-28
|
* Rename environment.nix -> nix.packageEelco Dolstra2013-10-28
|
* Remove uses of the "merge" option attributeEelco Dolstra2013-10-28
| | | | | It's redundant because you can (and should) specify an option type, or an apply function.
* Big cleanup of the NixOS module systemEelco Dolstra2013-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The major changes are: * The evaluation is now driven by the declared options. In particular, this fixes the long-standing problem with lack of laziness of disabled option definitions. Thus, a configuration like config = mkIf false { environment.systemPackages = throw "bla"; }; will now evaluate without throwing an error. This also improves performance since we're not evaluating unused option definitions. * The implementation of properties is greatly simplified. * There is a new type constructor "submodule" that replaces "optionSet". Unlike "optionSet", "submodule" gets its option declarations as an argument, making it more like "listOf" and other type constructors. A typical use is: foo = mkOption { type = type.attrsOf (type.submodule ( { config, ... }: { bar = mkOption { ... }; xyzzy = mkOption { ... }; })); }; Existing uses of "optionSet" are automatically mapped to "submodule". * Modules are now checked for unsupported attributes: you get an error if a module contains an attribute other than "config", "options" or "imports". * The new implementation is faster and uses much less memory.
* Get rid of the only use of mkNotdefEelco Dolstra2013-10-28
|
* Allow options to be marked as "internal"Eelco Dolstra2013-10-23
| | | | | This means they're not for end users. Currently they're filtered from the manual, but we could include them in a separate section.
* Get rid of special-casing of system.path in the manual generationEelco Dolstra2013-10-23
|
* Move all of NixOS to nixos/ in preparation of the repository mergeEelco Dolstra2013-10-10