Skip to content

Commit

Permalink
Merge branch 'master' into darwin-stdenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Taylor committed Aug 24, 2014
2 parents 7e4d4ce + 85ec51a commit 90b943f
Show file tree
Hide file tree
Showing 117 changed files with 2,887 additions and 1,528 deletions.
2 changes: 2 additions & 0 deletions lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
astsmtl = "Alexander Tsamutali <[email protected]>";
aszlig = "aszlig <[email protected]>";
auntie = "Jonathan Glines <[email protected]>";
aycanirican = "Aycan iRiCAN <[email protected]>";
bbenoist = "Baptist BENOIST <[email protected]>";
bennofs = "Benno Fünfstück <[email protected]>";
berdario = "Dario Bertini <[email protected]>";
bergey = "Daniel Bergey <[email protected]>";
bjg = "Brian Gough <[email protected]>";
bjornfor = "Bjørn Forsman <[email protected]>";
bluescreen303 = "Mathijs Kwik <[email protected]>";
Expand Down
6 changes: 6 additions & 0 deletions nixos/doc/manual/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,12 @@ a password. However, you can use the <command>passwd</command> program
to set a password, which is retained across invocations of
<command>nixos-rebuild</command>.</para>

<para>If you set users.mutableUsers to false, then the contents of /etc/passwd
and /etc/group will be congruent to your NixOS configuration. For instance,
if you remove a user from users.extraUsers and run nixos-rebuild, the user
account will cease to exist. Also, imperative commands for managing users
and groups, such as useradd, are no longer available.</para>

<para>A user ID (uid) is assigned automatically. You can also specify
a uid manually by adding

Expand Down
9 changes: 9 additions & 0 deletions nixos/modules/misc/ids.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
unifi = 131;
gdm = 132;
dhcpd = 133;
siproxd = 134;
mlmmj = 135;
neo4j = 136;
riemann = 137;
riemanndash = 138;

# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!

Expand Down Expand Up @@ -256,6 +261,10 @@
docker = 131;
gdm = 132;
tss = 133;
siproxd = 134;
mlmmj = 135;
riemann = 137;
riemanndash = 138;

# When adding a gid, make sure it doesn't match an existing uid. And don't use gids above 399!

Expand Down
6 changes: 6 additions & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
./services/databases/monetdb.nix
./services/databases/mongodb.nix
./services/databases/mysql.nix
./services/databases/neo4j.nix
./services/databases/openldap.nix
./services/databases/postgresql.nix
./services/databases/redis.nix
Expand Down Expand Up @@ -142,6 +143,7 @@
./services/mail/dovecot.nix
./services/mail/freepops.nix
./services/mail/mail.nix
./services/mail/mlmmj.nix
./services/mail/opensmtpd.nix
./services/mail/postfix.nix
./services/mail/spamassassin.nix
Expand All @@ -159,6 +161,7 @@
./services/misc/nix-ssh-serve.nix
./services/misc/rippled.nix
./services/misc/rogue.nix
./services/misc/siproxd.nix
./services/misc/svnserve.nix
./services/misc/synergy.nix
./services/monitoring/apcupsd.nix
Expand All @@ -167,6 +170,8 @@
./services/monitoring/monit.nix
./services/monitoring/munin.nix
./services/monitoring/nagios.nix
./services/monitoring/riemann.nix
./services/monitoring/riemann-dash.nix
./services/monitoring/smartd.nix
./services/monitoring/statsd.nix
./services/monitoring/systemhealth.nix
Expand Down Expand Up @@ -293,6 +298,7 @@
./services/x11/window-managers/awesome.nix
#./services/x11/window-managers/compiz.nix
./services/x11/window-managers/default.nix
./services/x11/window-managers/fluxbox.nix
./services/x11/window-managers/icewm.nix
./services/x11/window-managers/bspwm.nix
./services/x11/window-managers/metacity.nix
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/profiles/all-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{

# The initrd has to contain any module that might be necessary for
# mounting the CD/DVD.
# supporting the most important parts of HW like drives.
boot.initrd.availableKernelModules =
[ # SATA/PATA support.
"ahci"
Expand Down Expand Up @@ -43,7 +43,7 @@
"virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "virtio_console"

# Keyboards
"hid_apple"
"usbhid" "hid_apple" "hid_logitech_dj" "hid_lenovo_tpkbd" "hid_roccat"
];

# Include lots of firmware.
Expand Down
143 changes: 143 additions & 0 deletions nixos/modules/services/databases/neo4j.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.neo4j;

serverConfig = pkgs.writeText "neo4j-server.properties" ''
org.neo4j.server.database.location=${cfg.dataDir}/data/graph.db
org.neo4j.server.webserver.address=${cfg.host}
org.neo4j.server.webserver.port=${toString cfg.port}
${optionalString cfg.enableHttps ''
org.neo4j.server.webserver.https.enabled=true
org.neo4j.server.webserver.https.port=${toString cfg.httpsPort}
org.neo4j.server.webserver.https.cert.location=${cfg.cert}
org.neo4j.server.webserver.https.key.location=${cfg.key}
org.neo4j.server.webserver.https.keystore.location=${cfg.dataDir}/data/keystore
''}
org.neo4j.server.webadmin.rrdb.location=${cfg.dataDir}/data/rrd
org.neo4j.server.webadmin.data.uri=/db/data/
org.neo4j.server.webadmin.management.uri=/db/manage/
org.neo4j.server.db.tuning.properties=${pkgs.neo4j}/share/neo4j/conf/neo4j.properties
org.neo4j.server.manage.console_engines=shell
${cfg.extraServerConfig}
'';

loggingConfig = pkgs.writeText "logging.properties" cfg.loggingConfig;

wrapperConfig = pkgs.writeText "neo4j-wrapper.conf" ''
wrapper.java.additional=-Dorg.neo4j.server.properties=${serverConfig}
wrapper.java.additional=-Djava.util.logging.config.file=${loggingConfig}
wrapper.java.additional=-XX:+UseConcMarkSweepGC
wrapper.java.additional=-XX:+CMSClassUnloadingEnabled
wrapper.pidfile=${cfg.dataDir}/neo4j-server.pid
wrapper.name=neo4j
'';

in {

###### interface

options.services.neo4j = {
enable = mkOption {
description = "Whether to enable neo4j.";
default = false;
type = types.uniq types.bool;
};

host = mkOption {
description = "Neo4j listen address.";
default = "127.0.0.1";
type = types.str;
};

port = mkOption {
description = "Neo4j port to listen for HTTP traffic.";
default = 7474;
type = types.int;
};

enableHttps = mkOption {
description = "Enable https for Neo4j.";
default = false;
type = types.bool;
};

httpsPort = mkOption {
description = "Neo4j port to listen for HTTPS traffic.";
default = 7473;
type = types.int;
};

cert = mkOption {
description = "Neo4j https certificate.";
default = "${cfg.dataDir}/conf/ssl/neo4j.cert";
type = types.path;
};

key = mkOption {
description = "Neo4j https certificate key.";
default = "${cfg.dataDir}/conf/ssl/neo4j.key";
type = types.path;
};

dataDir = mkOption {
description = "Neo4j data directory.";
default = "/var/lib/neo4j";
type = types.path;
};

loggingConfig = mkOption {
description = "Neo4j logging configuration.";
default = ''
handlers=java.util.logging.ConsoleHandler
.level=INFO
org.neo4j.server.level=INFO
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=org.neo4j.server.logging.SimpleConsoleFormatter
java.util.logging.ConsoleHandler.filter=org.neo4j.server.logging.NeoLogFilter
'';
type = types.lines;
};

extraServerConfig = mkOption {
description = "Extra configuration for neo4j server.";
default = "";
type = types.lines;
};

};

###### implementation

config = mkIf cfg.enable {
systemd.services.neo4j = {
description = "Neo4j Daemon";
wantedBy = [ "multi-user.target" ];
after = [ "network-interfaces.target" ];
environment = { NEO4J_INSTANCE = cfg.dataDir; };
serviceConfig = {
ExecStart = "${pkgs.neo4j}/bin/neo4j console";
User = "neo4j";
PermissionsStartOnly = true;
};
preStart = ''
mkdir -m 0700 -p ${cfg.dataDir}/{data/graph.db,conf}
ln -fs ${wrapperConfig} ${cfg.dataDir}/conf/neo4j-wrapper.conf
if [ "$(id -u)" = 0 ]; then chown -R neo4j ${cfg.dataDir}; fi
'';
};

environment.systemPackages = [ pkgs.neo4j ];

users.extraUsers = singleton {
name = "neo4j";
uid = config.ids.uids.neo4j;
description = "Neo4j daemon user";
home = cfg.dataDir;
};
};

}
28 changes: 28 additions & 0 deletions nixos/modules/services/hardware/thermald.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.thermald;
in {
###### interface
options = {
services.thermald = {
enable = mkOption {
default = false;
description = ''
Whether to enable thermald, the temperature management daemon.
'';
};
};
};

###### implementation
config = mkIf cfg.enable {
systemd.services.thermald = {
description = "Thermal Daemon Service";
wantedBy = [ "multi-user.target" ];
script = "exec ${pkgs.thermald}/sbin/thermald --no-daemon --dbus-enable";
};
};
}
Loading

0 comments on commit 90b943f

Please sign in to comment.