Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Dec 29, 2016
2 parents e4f23bc + c2d90ea commit 9d09bc6
Show file tree
Hide file tree
Showing 110 changed files with 2,972 additions and 1,092 deletions.
3 changes: 3 additions & 0 deletions lib/maintainers.nix
Expand Up @@ -129,6 +129,7 @@
dochang = "Desmond O. Chang <dochang@gmail.com>";
domenkozar = "Domen Kozar <domen@dev.si>";
doublec = "Chris Double <chris.double@double.co.nz>";
dpaetzel = "David Pätzel <david.a.paetzel@gmail.com>";
drets = "Dmytro Rets <dmitryrets@gmail.com>";
drewkett = "Andrew Burkett <burkett.andrew@gmail.com>";
dtzWill = "Will Dietz <nix@wdtz.org>";
Expand Down Expand Up @@ -331,6 +332,7 @@
ocharles = "Oliver Charles <ollie@ocharles.org.uk>";
odi = "Oliver Dunkl <oliver.dunkl@gmail.com>";
offline = "Jaka Hudoklin <jakahudoklin@gmail.com>";
oida = "oida <oida@posteo.de>";
okasu = "Okasu <oka.sux@gmail.com>";
olcai = "Erik Timan <dev@timan.info>";
olejorgenb = "Ole Jørgen Brønner <olejorgenb@yahoo.no>";
Expand Down Expand Up @@ -506,4 +508,5 @@
zimbatm = "zimbatm <zimbatm@zimbatm.com>";
zohl = "Al Zohali <zohl@fmap.me>";
zoomulator = "Kim Simmons <zoomulator@gmail.com>";
zraexy = "David Mell <zraexy@gmail.com>";
}
2 changes: 1 addition & 1 deletion nixos/lib/make-squashfs.nix
Expand Up @@ -25,6 +25,6 @@ stdenv.mkDerivation {
# Generate the squashfs image.
mksquashfs nix-path-registration $storePaths $out \
-keep-as-directory -all-root -comp xz
-keep-as-directory -all-root -b 1048576 -comp xz -Xdict-size 100%
'';
}
8 changes: 6 additions & 2 deletions nixos/modules/installer/cd-dvd/installation-cd-minimal.nix
@@ -1,11 +1,15 @@
# This module defines a small NixOS installation CD. It does not
# contain any graphical stuff.

{ config, lib, ... }:
{ config, lib, pkgs, ... }:

{
imports =
[ ./installation-cd-base.nix
../../profiles/minimal.nix
];

environment.systemPackages =
[
pkgs.vim
];
}
2 changes: 1 addition & 1 deletion nixos/modules/misc/ids.nix
Expand Up @@ -467,7 +467,7 @@
ihaskell = 189;
i2p = 190;
lambdabot = 191;
#asterisk = 192; # unused
asterisk = 192;
plex = 193;
sabnzbd = 194;
#grafana = 196; #unused
Expand Down
11 changes: 10 additions & 1 deletion nixos/modules/misc/locate.nix
Expand Up @@ -15,6 +15,15 @@ in {
'';
};

locate = mkOption {
type = types.package;
default = pkgs.findutils;
example = "pkgs.mlocate";
description = ''
The locate implementation to use
'';
};

interval = mkOption {
type = types.str;
default = "02:15";
Expand Down Expand Up @@ -77,7 +86,7 @@ in {
script =
''
mkdir -m 0755 -p $(dirname ${toString cfg.output})
exec updatedb \
exec ${cfg.locate}/bin/updatedb \
--localuser=${cfg.localuser} \
${optionalString (!cfg.includeStore) "--prunepaths='/nix/store'"} \
--output=${toString cfg.output} ${concatStringsSep " " cfg.extraFlags}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/profiles/base.nix
Expand Up @@ -45,7 +45,7 @@
];

# Include support for various filesystems.
boot.supportedFilesystems = [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "zfs" "ntfs" "cifs" ];
boot.supportedFilesystems = [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ];

# Configure host id for ZFS to work
networking.hostId = lib.mkDefault "8425e349";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/monitoring/graphite.nix
Expand Up @@ -585,7 +585,7 @@ in {
serviceConfig = {
ExecStart = ''
${pkgs.pythonPackages.graphite_beacon}/bin/graphite-beacon \
--config ${pkgs.writeText "graphite-beacon.json" (builtins.toJSON cfg.beacon.config)}
--config=${pkgs.writeText "graphite-beacon.json" (builtins.toJSON cfg.beacon.config)}
'';
User = "graphite";
Group = "graphite";
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/monitoring/prometheus/alertmanager.nix
Expand Up @@ -62,8 +62,8 @@ in {
};

listenAddress = mkOption {
type = types.nullOr types.str;
default = null;
type = types.str;
default = "";
description = ''
Address to listen on for the web interface and API.
'';
Expand Down
60 changes: 47 additions & 13 deletions nixos/modules/services/networking/asterisk.nix
Expand Up @@ -6,29 +6,38 @@ let
cfg = config.services.asterisk;

asteriskUser = "asterisk";
asteriskGroup = "asterisk";

varlibdir = "/var/lib/asterisk";
spooldir = "/var/spool/asterisk";
logdir = "/var/log/asterisk";

# Add filecontents from files of useTheseDefaultConfFiles to confFiles, do not override
defaultConfFiles = subtractLists (attrNames cfg.confFiles) cfg.useTheseDefaultConfFiles;
allConfFiles =
cfg.confFiles //
builtins.listToAttrs (map (x: { name = x;
value = builtins.readFile (pkgs.asterisk + "/etc/asterisk/" + x); })
defaultConfFiles);

asteriskEtc = pkgs.stdenv.mkDerivation
((mapAttrs' (name: value: nameValuePair
# Fudge the names to make bash happy
((replaceChars ["."] ["_"] name) + "_")
(value)
) cfg.confFiles) //
) allConfFiles) //
{
confFilesString = concatStringsSep " " (
attrNames cfg.confFiles
attrNames allConfFiles
);

name = "asterisk.etc";
name = "asterisk-etc";

# Default asterisk.conf file
# (Notice that astetcdir will be set to the path of this derivation)
asteriskConf = ''
[directories]
astetcdir => @out@
astetcdir => /etc/asterisk
astmoddir => ${pkgs.asterisk}/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
Expand Down Expand Up @@ -169,6 +178,16 @@ in
'';
};

useTheseDefaultConfFiles = mkOption {
default = [ "ari.conf" "acl.conf" "agents.conf" "amd.conf" "calendar.conf" "cdr.conf" "cdr_syslog.conf" "cdr_custom.conf" "cel.conf" "cel_custom.conf" "cli_aliases.conf" "confbridge.conf" "dundi.conf" "features.conf" "hep.conf" "iax.conf" "pjsip.conf" "pjsip_wizard.conf" "phone.conf" "phoneprov.conf" "queues.conf" "res_config_sqlite3.conf" "res_parking.conf" "statsd.conf" "udptl.conf" "unistim.conf" ];
type = types.listOf types.str;
example = [ "sip.conf" "dundi.conf" ];
description = ''Sets these config files to the default content. The default value for
this option contains all necesscary files to avoid errors at startup.
This does not override settings via <option>services.asterisk.confFiles</option>.
'';
};

extraArguments = mkOption {
default = [];
type = types.listOf types.str;
Expand All @@ -182,12 +201,22 @@ in
};

config = mkIf cfg.enable {
users.extraUsers = singleton
{ name = asteriskUser;
uid = config.ids.uids.asterisk;
description = "Asterisk daemon user";
home = varlibdir;
};
environment.systemPackages = [ pkgs.asterisk ];

environment.etc.asterisk.source = asteriskEtc;

users.extraUsers.asterisk =
{ name = asteriskUser;
group = asteriskGroup;
uid = config.ids.uids.asterisk;
description = "Asterisk daemon user";
home = varlibdir;
};

users.extraGroups.asterisk =
{ name = asteriskGroup;
gid = config.ids.gids.asterisk;
};

systemd.services.asterisk = {
description = ''
Expand All @@ -196,14 +225,17 @@ in

wantedBy = [ "multi-user.target" ];

# Do not restart, to avoid disruption of running calls. Restart unit by yourself!
restartIfChanged = false;

preStart = ''
# Copy skeleton directory tree to /var
for d in '${varlibdir}' '${spooldir}' '${logdir}'; do
# TODO: Make exceptions for /var directories that likely should be updated
if [ ! -e "$d" ]; then
mkdir -p "$d"
cp --recursive ${pkgs.asterisk}/"$d" "$d"
chown --recursive ${asteriskUser} "$d"
cp --recursive ${pkgs.asterisk}/"$d"/* "$d"/
chown --recursive ${asteriskUser}:${asteriskGroup} "$d"
find "$d" -type d | xargs chmod 0755
fi
done
Expand All @@ -215,7 +247,9 @@ in
# FIXME: This doesn't account for arguments with spaces
argString = concatStringsSep " " cfg.extraArguments;
in
"${pkgs.asterisk}/bin/asterisk -U ${asteriskUser} -C ${asteriskEtc}/asterisk.conf ${argString} -F";
"${pkgs.asterisk}/bin/asterisk -U ${asteriskUser} -C /etc/asterisk/asterisk.conf ${argString} -F";
ExecReload = ''${pkgs.asterisk}/bin/asterisk -x "core reload"
'';
Type = "forking";
PIDFile = "/var/run/asterisk/asterisk.pid";
};
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/services/networking/bird.nix
Expand Up @@ -34,6 +34,7 @@ let

###### implementation
config = mkIf cfg.enable {
environment.systemPackages = [ pkg ];
systemd.services.${variant} = {
description = "BIRD Internet Routing Daemon";
wantedBy = [ "multi-user.target" ];
Expand Down
17 changes: 13 additions & 4 deletions nixos/modules/services/web-apps/atlassian/crowd.nix
Expand Up @@ -6,7 +6,12 @@ let

cfg = config.services.crowd;

pkg = pkgs.atlassian-crowd;
pkg = pkgs.atlassian-crowd.override {
home = cfg.home;
port = cfg.listenPort;
proxyUrl = "${cfg.proxy.scheme}://${cfg.proxy.name}:${toString cfg.proxy.port}";
openidPassword = cfg.openidPassword;
};

in

Expand Down Expand Up @@ -45,6 +50,11 @@ in
description = "Port to listen on.";
};

openidPassword = mkOption {
type = types.str;
description = "Application password for OpenID server.";
};

catalinaOptions = mkOption {
type = types.listOf types.str;
default = [];
Expand Down Expand Up @@ -119,10 +129,10 @@ in
};

preStart = ''
mkdir -p ${cfg.home}/{logs,work}
mkdir -p ${cfg.home}/{logs,work,database}
mkdir -p /run/atlassian-crowd
ln -sf ${cfg.home}/{work,server.xml} /run/atlassian-crowd
ln -sf ${cfg.home}/{database,work,server.xml} /run/atlassian-crowd
chown -R ${cfg.user} ${cfg.home}
Expand All @@ -134,7 +144,6 @@ in
'';

script = "${pkg}/start_crowd.sh";
#stopScript = "${pkg}/bin/stop_crowd.sh";

serviceConfig = {
User = cfg.user;
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/x11/hardware/wacom.nix
Expand Up @@ -22,7 +22,7 @@ in
which will make Xorg reconfigure the device ?
If you're not satisfied by the default behaviour you can override
<option>environment.etc."X11/xorg.conf.d/50-wacom.conf"</option> in
<option>environment.etc."X11/xorg.conf.d/70-wacom.conf"</option> in
configuration.nix easily.
'';
};
Expand All @@ -40,7 +40,7 @@ in

services.udev.packages = [ pkgs.xf86_input_wacom ];

environment.etc."X11/xorg.conf.d/50-wacom.conf".source = "${pkgs.xf86_input_wacom}/share/X11/xorg.conf.d/50-wacom.conf";
environment.etc."X11/xorg.conf.d/70-wacom.conf".source = "${pkgs.xf86_input_wacom}/share/X11/xorg.conf.d/70-wacom.conf";

};

Expand Down
89 changes: 89 additions & 0 deletions pkgs/applications/graphics/ImageMagick/7.0.nix
@@ -0,0 +1,89 @@
{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libtool
, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
, lcms2, openexr, libpng, librsvg, libtiff, libxml2, openjpeg, libwebp
}:

let
arch =
if stdenv.system == "i686-linux" then "i686"
else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
else if stdenv.system == "armv7l-linux" then "armv7l"
else throw "ImageMagick is not supported on this platform.";

cfg = {
version = "7.0.4-0";
sha256 = "0hfkdvfl60f9ksh07c06cpq8ib05apczl767yyvc671gd90n11ds";
patches = [];
};
in

stdenv.mkDerivation rec {
name = "imagemagick-${version}";
inherit (cfg) version;

src = fetchurl {
urls = [
"mirror://imagemagick/releases/ImageMagick-${version}.tar.xz"
# the original source above removes tarballs quickly
"http://distfiles.macports.org/ImageMagick/ImageMagick-${version}.tar.xz"
"https://bintray.com/homebrew/mirror/download_file?file_path=imagemagick-${version}.tar.xz"
];
inherit (cfg) sha256;
};

patches = [ ./imagetragick.patch ] ++ cfg.patches;

outputs = [ "out" "dev" "doc" ]; # bin/ isn't really big
outputMan = "out"; # it's tiny

enableParallelBuilding = true;

configureFlags =
[ "--with-frozenpaths" ]
++ [ "--with-gcc-arch=${arch}" ]
++ lib.optional (librsvg != null) "--with-rsvg"
++ lib.optionals (ghostscript != null)
[ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
"--with-gslib"
]
++ lib.optionals (stdenv.cross.libc or null == "msvcrt")
[ "--enable-static" "--disable-shared" ] # due to libxml2 being without DLLs ATM
;

nativeBuildInputs = [ pkgconfig libtool ];

buildInputs =
[ zlib fontconfig freetype ghostscript
libpng libtiff libxml2
]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt")
[ openexr librsvg openjpeg ]
;

propagatedBuildInputs =
[ bzip2 freetype libjpeg lcms2 ]
++ lib.optionals (stdenv.cross.libc or null != "msvcrt")
[ libX11 libXext libXt libwebp ]
;

postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)
moveToOutput "bin/*-config" "$dev"
moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params
for file in "$dev"/bin/*-config; do
substituteInPlace "$file" --replace pkg-config \
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkgconfig}/bin/pkg-config'"
done
'' + lib.optionalString (ghostscript != null) ''
for la in $out/lib/*.la; do
sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la
done
'';

meta = with stdenv.lib; {
homepage = http://www.imagemagick.org/;
description = "A software suite to create, edit, compose, or convert bitmap images";
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ the-kenny wkennington ];
};
}

0 comments on commit 9d09bc6

Please sign in to comment.