Merge master into #2129
Conflicts (easy, just UID shifted): nixos/modules/misc/ids.nix nixos/modules/module-list.nix
This commit is contained in:
@@ -2,14 +2,6 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
failed = map (x: x.message) (filter (x: !x.assertion) config.assertions);
|
||||
|
||||
showWarnings = res: fold (w: x: builtins.trace "[1;31mwarning: ${w}[0m" x) res config.warnings;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
@@ -38,15 +30,5 @@ in
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
# This option is evaluated always. Thus the assertions are checked
|
||||
# as well. Hacky!
|
||||
environment.systemPackages = showWarnings (
|
||||
if [] == failed then []
|
||||
else throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failed)}");
|
||||
|
||||
};
|
||||
|
||||
# impl of assertions is in <nixos/modules/system/activation/top-level.nix>
|
||||
}
|
||||
|
||||
+34
-16
@@ -1,19 +1,19 @@
|
||||
# This module defines the global list of uids and gids. We keep a
|
||||
# central list to prevent id collisions.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
ids.uids = pkgs.lib.mkOption {
|
||||
ids.uids = lib.mkOption {
|
||||
internal = true;
|
||||
description = ''
|
||||
The user IDs used in NixOS.
|
||||
'';
|
||||
};
|
||||
|
||||
ids.gids = pkgs.lib.mkOption {
|
||||
ids.gids = lib.mkOption {
|
||||
internal = true;
|
||||
description = ''
|
||||
The group IDs used in NixOS.
|
||||
@@ -52,13 +52,13 @@
|
||||
osgi = 34;
|
||||
tor = 35;
|
||||
cups = 36;
|
||||
foldingAtHome = 37;
|
||||
foldingathome = 37;
|
||||
sabnzbd = 38;
|
||||
kdm = 39;
|
||||
ghostOne = 40;
|
||||
ghostone = 40;
|
||||
git = 41;
|
||||
fourStore = 42;
|
||||
fourStoreEndpoint = 43;
|
||||
fourstore = 42;
|
||||
fourstorehttp = 43;
|
||||
virtuoso = 44;
|
||||
rtkit = 45;
|
||||
dovecot2 = 46;
|
||||
@@ -84,7 +84,7 @@
|
||||
postgres = 71;
|
||||
smbguest = 74;
|
||||
varnish = 75;
|
||||
dd-agent = 76;
|
||||
datadog = 76;
|
||||
lighttpd = 77;
|
||||
lightdm = 78;
|
||||
freenet = 79;
|
||||
@@ -129,10 +129,19 @@
|
||||
foundationdb = 118;
|
||||
newrelic = 119;
|
||||
starbound = 120;
|
||||
hydra = 122;
|
||||
spiped = 123;
|
||||
hydra = 122;
|
||||
spiped = 123;
|
||||
teamspeak = 124;
|
||||
influxdb = 125;
|
||||
nsd = 126;
|
||||
gitolite = 127;
|
||||
znc = 128;
|
||||
polipo = 129;
|
||||
mopidy = 130;
|
||||
unifi = 131;
|
||||
gdm = 132;
|
||||
|
||||
# When adding a uid, make sure it doesn't match an existing gid.
|
||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||
|
||||
nixbld = 30000; # start of range of uids
|
||||
nobody = 65534;
|
||||
@@ -173,8 +182,8 @@
|
||||
osgi = 34;
|
||||
ghostOne = 40;
|
||||
git = 41;
|
||||
fourStore = 42;
|
||||
fourStoreEndpoint = 43;
|
||||
fourstore = 42;
|
||||
fourstorehttpd = 43;
|
||||
virtuoso = 44;
|
||||
dovecot2 = 46;
|
||||
prayer = 49;
|
||||
@@ -201,7 +210,7 @@
|
||||
vboxsf = 73;
|
||||
smbguest = 74;
|
||||
varnish = 75;
|
||||
dd-agent = 76;
|
||||
datadog = 76;
|
||||
lighttpd = 77;
|
||||
lightdm = 78;
|
||||
freenet = 79;
|
||||
@@ -236,9 +245,18 @@
|
||||
grsecurity = 121;
|
||||
hydra = 122;
|
||||
spiped = 123;
|
||||
tss = 124;
|
||||
teamspeak = 124;
|
||||
influxdb = 125;
|
||||
nsd = 126;
|
||||
firebird = 127;
|
||||
znc = 128;
|
||||
polipo = 129;
|
||||
mopidy = 130;
|
||||
docker = 131;
|
||||
gdm = 132;
|
||||
tss = 133;
|
||||
|
||||
# When adding a gid, make sure it doesn't match an existing uid.
|
||||
# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!
|
||||
|
||||
users = 100;
|
||||
nixbld = 30000;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
lib = pkgs.lib.mkOption {
|
||||
lib = lib.mkOption {
|
||||
default = {};
|
||||
|
||||
type = pkgs.lib.types.attrsOf pkgs.lib.types.attrs;
|
||||
type = lib.types.attrsOf lib.types.attrs;
|
||||
|
||||
description = ''
|
||||
This option allows modules to define helper functions, constants, etc.
|
||||
|
||||
@@ -3,12 +3,8 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
locatedb = "/var/cache/locatedb";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
cfg = config.services.locate;
|
||||
in {
|
||||
|
||||
###### interface
|
||||
|
||||
@@ -35,6 +31,31 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra flags to append to <command>updatedb</command>.
|
||||
'';
|
||||
};
|
||||
|
||||
output = mkOption {
|
||||
type = types.path;
|
||||
default = /var/cache/locatedb;
|
||||
description = ''
|
||||
The database file to build.
|
||||
'';
|
||||
};
|
||||
|
||||
localuser = mkOption {
|
||||
type = types.str;
|
||||
default = "nobody";
|
||||
description = ''
|
||||
The user to search non-network directories as, using
|
||||
<command>su</command>.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
@@ -48,8 +69,10 @@ in
|
||||
path = [ pkgs.su ];
|
||||
script =
|
||||
''
|
||||
mkdir -m 0755 -p $(dirname ${locatedb})
|
||||
exec updatedb --localuser=nobody --output=${locatedb} --prunepaths='/tmp /var/tmp /media /run'
|
||||
mkdir -m 0755 -p $(dirname ${toString cfg.output})
|
||||
exec updatedb \
|
||||
--localuser=${cfg.localuser} \
|
||||
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}
|
||||
'';
|
||||
serviceConfig.Nice = 19;
|
||||
serviceConfig.IOSchedulingClass = "idle";
|
||||
|
||||
@@ -62,8 +62,7 @@ in
|
||||
type = types.str;
|
||||
description = ''
|
||||
Specifies the Nix platform type for which NixOS should be built.
|
||||
If unset, it defaults to the platform type of your host system
|
||||
(<literal>${builtins.currentSystem}</literal>).
|
||||
If unset, it defaults to the platform type of your host system.
|
||||
Specifying this option is useful when doing distributed
|
||||
multi-platform deployment, or when building virtual machines.
|
||||
'';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# This module allows you to export something from configuration
|
||||
# Use case: export kernel source expression for ease of configuring
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
passthru = pkgs.lib.mkOption {
|
||||
passthru = lib.mkOption {
|
||||
visible = false;
|
||||
description = ''
|
||||
This attribute set will be exported as a system attribute.
|
||||
|
||||
@@ -53,7 +53,7 @@ with lib;
|
||||
mkDefault (if pathExists fn then readFile fn else "master");
|
||||
|
||||
# Note: code names must only increase in alphabetical order.
|
||||
system.nixosCodeName = "Baboon";
|
||||
system.nixosCodeName = "Caterpillar";
|
||||
|
||||
# Generate /etc/os-release. See
|
||||
# http://0pointer.de/public/systemd-man/os-release.html for the
|
||||
|
||||
Reference in New Issue
Block a user