Merge branch 'master.upstream' into staging.upstream

This commit is contained in:
William A. Kennington III 2015-09-29 15:54:33 -07:00
commit 271972de0a
546 changed files with 25528 additions and 2488 deletions

View File

@ -127,7 +127,7 @@ in ...</programlisting>
<title>lib.makeOverridable</title>
<para>
The function <varname>lib.makeOverridable</varname> is used make the result
The function <varname>lib.makeOverridable</varname> is used to make the result
of a function easily customizable. This utility only makes sense for functions
that accept an argument set and return an attribute set.
</para>

View File

@ -11,14 +11,13 @@
registered on
<link xlink:href="http://hackage.haskell.org/">Hackage</link>, but
strangely enough normal Nix package lookups don't seem to discover
any of them:
any of them, except for the default version of ghc, cabal-install, and stack:
</para>
<programlisting>
$ nix-env -qa cabal-install
error: selector cabal-install matches no derivations
$ nix-env -i ghc
error: selector ghc matches no derivations
$ nix-env -i alex
error: selector alex matches no derivations
$ nix-env -qa ghc
ghc-7.10.2
</programlisting>
<para>
The Haskell package set is not registered in the top-level namespace

View File

@ -981,6 +981,72 @@ stdenv.mkDerivation {
</programlisting>
</section>
<section xml:id="sec-language-qt"><title>Qt</title>
<para>The information in this section applies to Qt 5.5 and later.</para>
<para>Qt is an application development toolkit for C++. Although it is
not a distinct programming language, there are special considerations
for packaging Qt-based programs and libraries. A small set of tools
and conventions has grown out of these considerations.</para>
<section xml:id="ssec-qt-libraries"><title>Libraries</title>
<para>Packages that provide libraries should be listed in
<varname>qt5LibsFun</varname> so that the library is built with each
Qt version. A set of packages is provided for each version of Qt; for
example, <varname>qt5Libs</varname> always provides libraries built
with the latest version, <varname>qt55Libs</varname> provides
libraries built with Qt 5.5, and so on. To avoid version conflicts, no
top-level attributes are created for these packages.</para>
</section>
<section xml:id="ssec-qt-programs"><title>Programs</title>
<para>Application packages do not need to be built with every Qt
version. To ensure consistency between the package's dependencies,
call the package with <literal>qt5Libs.callPackage</literal> instead
of the usual <literal>callPackage</literal>. An older version may be
selected in case of incompatibility. For example, to build with Qt
5.5, call the package with
<literal>qt55Libs.callPackage</literal>.</para>
<para>Several environment variables must be set at runtime for Qt
applications to function correctly, including:</para>
<itemizedlist>
<listitem><para><envar>QT_PLUGIN_PATH</envar></para></listitem>
<listitem><para><envar>QML_IMPORT_PATH</envar></para></listitem>
<listitem><para><envar>QML2_IMPORT_PATH</envar></para></listitem>
<listitem><para><envar>XDG_DATA_DIRS</envar></para></listitem>
</itemizedlist>
<para>To ensure that these are set correctly, the program must be wrapped by
invoking <literal>wrapQtProgram <replaceable>program</replaceable></literal>
during installation (for example, during
<literal>fixupPhase</literal>). <literal>wrapQtProgram</literal>
accepts the same options as <literal>makeWrapper</literal>.
</para>
</section>
<section xml:id="ssec-qt-kde"><title>KDE</title>
<para>Many of the considerations above also apply to KDE packages,
especially the need to set the correct environment variables at
runtime. To ensure that this is done, invoke <literal>wrapKDEProgram
<replaceable>program</replaceable></literal> during
installation. <literal>wrapKDEProgram</literal> also generates a
<literal>ksycoca</literal> database so that required data and services
can be found. Like its Qt counterpart,
<literal>wrapKDEProgram</literal> accepts the same options as
<literal>makeWrapper</literal>.</para>
</section>
</section>
<!--
<section><title>Haskell</title>

View File

@ -1204,7 +1204,7 @@ echo @foo@
</varlistentry>
<varlistentry>
<term>Qt</term>
<term>Qt 4</term>
<listitem><para>Sets the <envar>QTDIR</envar> environment variable
to Qts path.</para></listitem>
</varlistentry>

View File

@ -164,4 +164,23 @@ rec {
drv' = (lib.head outputsList).value;
in lib.deepSeq drv' drv';
/* Make a set of packages with a common scope. All packages called
with the provided `callPackage' will be evaluated with the same
arguments. Any package in the set may depend on any other. The
`override' function allows subsequent modification of the package
set in a consistent way, i.e. all packages in the set will be
called with the overridden packages. The package sets may be
hierarchical: the packages in the set are called with the scope
provided by `newScope' and the set provides a `newScope' attribute
which can form the parent scope for later package sets. */
makeScope = newScope: f:
let self = f self // {
newScope = scope: newScope (self // scope);
callPackage = self.newScope {};
override = g: makeScope newScope (self_:
let super = f self_;
in super // g super self_);
};
in self;
}

View File

@ -155,6 +155,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "GNU Free Documentation License v1.2";
};
fdl13 = spdx {
spdxId = "GFDL-1.3";
fullName = "GNU Free Documentation License v1.2";
};
free = {
fullName = "Unspecified free software license";
};

View File

@ -31,10 +31,8 @@ let
else
fn;
# Convert the list of options into an XML file. The builtin
# unsafeDiscardStringContext is used to prevent the realisation of
# the store paths which are used in options definitions.
optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList'));
# Convert the list of options into an XML file.
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList');
optionsDocBook = runCommand "options-db.xml" {} ''
optionsXML=${optionsXML}
@ -139,6 +137,8 @@ in rec {
''; # */
meta.description = "The NixOS manual in HTML format";
allowedReferences = ["out"];
};
manualPDF = stdenv.mkDerivation {
@ -187,6 +187,8 @@ in rec {
${docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
./man-pages.xml
'';
allowedReferences = ["out"];
};
}

View File

@ -104,27 +104,40 @@ which contains the latest Elm platform.</para></listitem>
<para>Local printers are no longer shared or advertised by
default. This behavior can be changed by enabling
<literal>services.printing.defaultShared</literal> or
<literal>services.printing.browsing</literal> respectively.</para>
<option>services.printing.defaultShared</option> or
<option>services.printing.browsing</option> respectively.</para>
</listitem>
<listitem>
<para>
The VirtualBox host and guest options have been named more
consistently. They can now found in
<literal>virtualisation.virtualbox.host.*</literal> instead of
<literal>services.virtualboxHost.*</literal> and
<literal>virtualisation.virtualbox.guest.*</literal> instead of
<literal>services.virtualboxGuest.*</literal>.
<option>virtualisation.virtualbox.host.*</option> instead of
<option>services.virtualboxHost.*</option> and
<option>virtualisation.virtualbox.guest.*</option> instead of
<option>services.virtualboxGuest.*</option>.
</para>
<para>
Also, there now is support for the <literal>vboxsf</literal> file
system using the <option>fileSystems</option> configuration
attribute. An example of how this can be used in a configuration:
<programlisting>
fileSystems."/shiny" = {
device = "myshinysharedfolder";
fsType = "vboxsf";
};
</programlisting>
</para>
</listitem>
<listitem>
<para>
Haskell packages can no longer be found by name, i.e. the commands
<literal>nix-env -qa cabal-install</literal> and <literal>nix-env -i
ghc</literal> will fail, even though we <emphasis>do</emphasis> ship
both <literal>cabal-install</literal> and <literal>ghc</literal>.
Haskell packages can no longer be found by name, except for
<literal>ghc</literal>, <literal>cabal-install</literal>, and
<literal>stack</literal>, even though we do package the whole Hackage.
The reason for this inconvenience is the sheer size of the Haskell
package set: name-based lookups such as these would become much
slower than they are today if we'd add the entire Hackage database
@ -203,7 +216,7 @@ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA haskellPackages.cabal-install
The <literal>locate</literal> service no longer indexes the Nix store
by default, preventing packages with potentially numerous versions from
cluttering the output. Indexing the store can be activated by setting
<literal>services.locate.includeStore = true</literal>.
<option>services.locate.includeStore = true</option>.
</para>
</listitem>
@ -239,10 +252,22 @@ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA haskellPackages.cabal-install
discovered in the Diffie-Hellman key exchange</link> can now
replace OpenSSH's default version with one they generated
themselves using the new
<literal>services.openssh.moduliFile</literal> option.
<option>services.openssh.moduliFile</option> option.
</para>
</listitem>
<listitem> <para>
A newly packaged TeX Live 2015 is provided in <literal>pkgs.texlive</literal>,
split into 6500 nix packages. For basic user documentation see
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/release-15.09/pkgs/tools/typesetting/tex/texlive-new/default.nix#L1"
>the source</link>.
Beware of <link xlink:href="https://github.com/NixOS/nixpkgs/issues/9757"
>an issue</link> when installing a too large package set.
The plan is to deprecate and maybe delete the original TeX packages
until the next release.
</para> </listitem>
</itemizedlist>
</para>

View File

@ -0,0 +1,115 @@
{ pkgs
, lib
, # The NixOS configuration to be installed onto the disk image.
config
, # The size of the disk, in megabytes.
diskSize
, # Whether the disk should be partitioned (with a single partition
# containing the root filesystem) or contain the root filesystem
# directly.
partitioned ? true
, # The root file system type.
fsType ? "ext4"
, # The initial NixOS configuration file to be copied to
# /etc/nixos/configuration.nix.
configFile ? null
, # Shell code executed after the VM has finished.
postVM ? ""
}:
with lib;
pkgs.vmTools.runInLinuxVM (
pkgs.runCommand "nixos-disk-image"
{ preVM =
''
mkdir $out
diskImage=$out/nixos.img
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage "${toString diskSize}M"
mv closure xchg/
'';
buildInputs = [ pkgs.utillinux pkgs.perl pkgs.e2fsprogs pkgs.parted ];
exportReferencesGraph =
[ "closure" config.system.build.toplevel ];
inherit postVM;
}
''
${if partitioned then ''
# Create a single / partition.
parted /dev/vda mklabel msdos
parted /dev/vda -- mkpart primary ext2 1M -1s
. /sys/class/block/vda1/uevent
mknod /dev/vda1 b $MAJOR $MINOR
rootDisk=/dev/vda1
'' else ''
rootDisk=/dev/vda
''}
# Create an empty filesystem and mount it.
mkfs.${fsType} -L nixos $rootDisk
${optionalString (fsType == "ext4") ''
tune2fs -c 0 -i 0 $rootDisk
''}
mkdir /mnt
mount $rootDisk /mnt
# The initrd expects these directories to exist.
mkdir /mnt/dev /mnt/proc /mnt/sys
mount -o bind /proc /mnt/proc
mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
# Copy all paths in the closure to the filesystem.
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
mkdir -p /mnt/nix/store
echo "copying everything (will take a while)..."
set -f
cp -prd $storePaths /mnt/nix/store/
# Register the paths in the Nix database.
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
chroot /mnt ${config.nix.package}/bin/nix-store --load-db --option build-users-group ""
# Add missing size/hash fields to the database. FIXME:
# exportReferencesGraph should provide these directly.
chroot /mnt ${config.nix.package}/bin/nix-store --verify --check-contents
# Create the system profile to allow nixos-rebuild to work.
chroot /mnt ${config.nix.package}/bin/nix-env --option build-users-group "" \
-p /nix/var/nix/profiles/system --set ${config.system.build.toplevel}
# `nixos-rebuild' requires an /etc/NIXOS.
mkdir -p /mnt/etc
touch /mnt/etc/NIXOS
# `switch-to-configuration' requires a /bin/sh
mkdir -p /mnt/bin
ln -s ${config.system.build.binsh}/bin/sh /mnt/bin/sh
# Install a configuration.nix.
mkdir -p /mnt/etc/nixos
${optionalString (configFile != null) ''
cp ${configFile} /mnt/etc/nixos/configuration.nix
''}
# Generate the GRUB menu.
ln -s vda /dev/xvda
ln -s vda /dev/sda
chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot
umount /mnt/proc /mnt/dev /mnt/sys
umount /mnt
# Do an fsck to make sure resize2fs works.
fsck.${fsType} -f -y $rootDisk
''
)

View File

@ -1,5 +0,0 @@
{ modulesPath, ...}:
{
imports = [ "${modulesPath}/virtualisation/amazon-init.nix" ];
services.journald.rateLimitBurst = 0;
}

View File

@ -1,5 +0,0 @@
{ config, pkgs, ...}:
{
imports = [ ./amazon-base-config.nix ];
ec2.hvm = true;
}

View File

@ -1,34 +0,0 @@
{ config, pkgs, lib, ...}:
let
cloudUtils = pkgs.fetchurl {
url = "https://launchpad.net/cloud-utils/trunk/0.27/+download/cloud-utils-0.27.tar.gz";
sha256 = "16shlmg36lidp614km41y6qk3xccil02f5n3r4wf6d1zr5n4v8vd";
};
growpart = pkgs.stdenv.mkDerivation {
name = "growpart";
src = cloudUtils;
buildPhase = ''
cp bin/growpart $out
sed -i 's|awk|gawk|' $out
sed -i 's|sed|gnused|' $out
'';
dontInstall = true;
dontPatchShebangs = true;
};
in
{
imports = [ ./amazon-base-config.nix ];
ec2.hvm = true;
boot.loader.grub.device = lib.mkOverride 0 "/dev/xvdg";
boot.kernelParams = [ "console=ttyS0" ];
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.gawk}/bin/gawk
copy_bin_and_libs ${pkgs.gnused}/bin/sed
copy_bin_and_libs ${pkgs.utillinux}/sbin/sfdisk
cp -v ${growpart} $out/bin/growpart
'';
boot.initrd.postDeviceCommands = ''
[ -e /dev/xvda ] && [ -e /dev/xvda1 ] && TMPDIR=/run sh $(type -P growpart) /dev/xvda 1
'';
}

View File

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
with lib;
{
imports =
[ ../../../modules/installer/cd-dvd/channel.nix
../../../modules/virtualisation/amazon-image.nix
];
system.build.amazonImage = import ../../../lib/make-disk-image.nix {
inherit pkgs lib config;
partitioned = config.ec2.hvm;
diskSize = if config.ec2.hvm then 2048 else 8192;
configFile = pkgs.writeText "configuration.nix"
''
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
${optionalString config.ec2.hvm ''
ec2.hvm = true;
''}
}
'';
};
}

View File

@ -0,0 +1,217 @@
#! /bin/sh -e
set -o pipefail
#set -x
stateDir=${TMPDIR:-/tmp}/ec2-image
echo "keeping state in $stateDir"
mkdir -p $stateDir
version=$(nix-instantiate --eval --strict '<nixpkgs>' -A lib.nixpkgsVersion | sed s/'"'//g)
echo "NixOS version is $version"
rm -f ec2-amis.nix
for type in hvm pv; do
link=$stateDir/$type
imageFile=$link/nixos.img
system=x86_64-linux
arch=x86_64
# Build the image.
if ! [ -L $link ]; then
if [ $type = pv ]; then hvmFlag=false; else hvmFlag=true; fi
echo "building image type '$type'..."
nix-build -o $link \
'<nixpkgs/nixos>' \
-A config.system.build.amazonImage \
--arg configuration "{ imports = [ <nixpkgs/nixos/maintainers/scripts/ec2/amazon-image.nix> ]; ec2.hvm = $hvmFlag; }"
fi
for store in ebs s3; do
bucket=nixos-amis
bucketDir="$version-$type-$store"
prevAmi=
prevRegion=
for region in eu-west-1 eu-central-1 us-east-1 us-west-1 us-west-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 sa-east-1; do
name=nixos-$version-$arch-$type-$store
description="NixOS $system $version ($type-$store)"
amiFile=$stateDir/$region.$type.$store.ami-id
if ! [ -e $amiFile ]; then
echo "doing $name in $region..."
if [ -n "$prevAmi" ]; then
ami=$(ec2-copy-image \
--region "$region" \
--source-region "$prevRegion" --source-ami-id "$prevAmi" \
--name "$name" --description "$description" | cut -f 2)
else
if [ $store = s3 ]; then
# Bundle the image.
imageDir=$stateDir/$type-bundled
if ! [ -d $imageDir ]; then
rm -rf $imageDir.tmp
mkdir -p $imageDir.tmp
ec2-bundle-image \
-d $imageDir.tmp \
-i $imageFile --arch $arch \
--user "$AWS_ACCOUNT" -c "$EC2_CERT" -k "$EC2_PRIVATE_KEY"
mv $imageDir.tmp $imageDir
fi
# Upload the bundle to S3.
if ! [ -e $imageDir/uploaded ]; then
echo "uploading bundle to S3..."
ec2-upload-bundle \
-m $imageDir/nixos.img.manifest.xml \
-b "$bucket/$bucketDir" \
-a "$EC2_ACCESS_KEY" -s "$EC2_SECRET_KEY" \
--location EU
touch $imageDir/uploaded
fi
extraFlags="$bucket/$bucketDir/nixos.img.manifest.xml"
else
# Convert the image to vhd format so we don't have
# to upload a huge raw image.
vhdFile=$stateDir/$type.vhd
if ! [ -e $vhdFile ]; then
qemu-img convert -O vpc $imageFile $vhdFile.tmp
mv $vhdFile.tmp $vhdFile
fi
taskId=$(cat $stateDir/$region.$type.task-id 2> /dev/null || true)
volId=$(cat $stateDir/$region.$type.vol-id 2> /dev/null || true)
snapId=$(cat $stateDir/$region.$type.snap-id 2> /dev/null || true)
# Import the VHD file.
if [ -z "$snapId" -a -z "$volId" -a -z "$taskId" ]; then
echo "importing $vhdFile..."
taskId=$(ec2-import-volume $vhdFile --no-upload -f vhd \
-o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY" \
--region "$region" -z "${region}a" \
--bucket "$bucket" --prefix "$bucketDir/" \
| tee /dev/stderr \
| sed 's/.*\(import-vol-[0-9a-z]\+\).*/\1/ ; t ; d')
echo -n "$taskId" > $stateDir/$region.$type.task-id
fi
if [ -z "$snapId" -a -z "$volId" ]; then
ec2-resume-import $vhdFile -t "$taskId" --region "$region" \
-o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY"
fi
# Wait for the volume creation to finish.
if [ -z "$snapId" -a -z "$volId" ]; then
echo "waiting for import to finish..."
while true; do
volId=$(ec2-describe-conversion-tasks "$taskId" --region "$region" | sed 's/.*VolumeId.*\(vol-[0-9a-f]\+\).*/\1/ ; t ; d')
if [ -n "$volId" ]; then break; fi
sleep 10
done
echo -n "$volId" > $stateDir/$region.$type.vol-id
fi
# Delete the import task.
if [ -n "$volId" -a -n "$taskId" ]; then
echo "removing import task..."
ec2-delete-disk-image -t "$taskId" --region "$region" -o "$EC2_ACCESS_KEY" -w "$EC2_SECRET_KEY" || true
rm -f $stateDir/$region.$type.task-id
fi
# Create a snapshot.
if [ -z "$snapId" ]; then
echo "creating snapshot..."
snapId=$(ec2-create-snapshot "$volId" --region "$region" | cut -f 2)
echo -n "$snapId" > $stateDir/$region.$type.snap-id
ec2-create-tags "$snapId" -t "Name=$description" --region "$region"
fi
# Wait for the snapshot to finish.
echo "waiting for snapshot to finish..."
while true; do
status=$(ec2-describe-snapshots "$snapId" --region "$region" | head -n1 | cut -f 4)
if [ "$status" = completed ]; then break; fi
sleep 10
done
# Delete the volume.
if [ -n "$volId" ]; then
echo "deleting volume..."
ec2-delete-volume "$volId" --region "$region" || true
rm -f $stateDir/$region.$type.vol-id
fi
extraFlags="-b /dev/sda1=$snapId:20:true:gp2"
if [ $type = pv ]; then
extraFlags+=" --root-device-name=/dev/sda1"
fi
extraFlags+=" -b /dev/sdb=ephemeral0 -b /dev/sdc=ephemeral1 -b /dev/sdd=ephemeral2 -b /dev/sde=ephemeral3"
fi
# Register the AMI.
if [ $type = pv ]; then
kernel=$(ec2-describe-images -o amazon --filter "manifest-location=*pv-grub-hd0_1.04-$arch*" --region "$region" | cut -f 2)
[ -n "$kernel" ]
echo "using PV-GRUB kernel $kernel"
extraFlags+=" --virtualization-type paravirtual --kernel $kernel"
else
extraFlags+=" --virtualization-type hvm"
fi
ami=$(ec2-register \
-n "$name" \
-d "$description" \
--region "$region" \
--architecture "$arch" \
$extraFlags | cut -f 2)
fi
echo -n "$ami" > $amiFile
echo "created AMI $ami of type '$type' in $region..."
else
ami=$(cat $amiFile)
fi
if [ -z "$NO_WAIT" -o -z "$prevAmi" ]; then
echo "waiting for AMI..."
while true; do
status=$(ec2-describe-images "$ami" --region "$region" | head -n1 | cut -f 5)
if [ "$status" = available ]; then break; fi
sleep 10
done
ec2-modify-image-attribute \
--region "$region" "$ami" -l -a all
fi
echo "region = $region, type = $type, store = $store, ami = $ami"
if [ -z "$prevAmi" ]; then
prevAmi="$ami"
prevRegion="$region"
fi
echo " \"15.09\".$region.$type-$store = \"$ami\";" >> ec2-amis.nix
done
done
done

View File

@ -1,216 +0,0 @@
#! /usr/bin/env python
import os
import sys
import time
import argparse
import nixops.util
from nixops import deployment
from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
import boto.ec2
from nixops.statefile import StateFile, get_default_state_file
parser = argparse.ArgumentParser(description='Create an EBS-backed NixOS AMI')
parser.add_argument('--region', dest='region', required=True, help='EC2 region to create the image in')
parser.add_argument('--channel', dest='channel', default="14.12", help='Channel to use')
parser.add_argument('--keep', dest='keep', action='store_true', help='Keep NixOps machine after use')
parser.add_argument('--hvm', dest='hvm', action='store_true', help='Create HVM image')
parser.add_argument('--key', dest='key_name', action='store_true', help='Keypair used for HVM instance creation', default="rob")
args = parser.parse_args()
instance_type = "m3.medium" if args.hvm else "m1.small"
if args.hvm:
virtualization_type = "hvm"
root_block = "/dev/sda1"
image_type = 'hvm'
else:
virtualization_type = "paravirtual"
root_block = "/dev/sda"
image_type = 'ebs'
ebs_size = 20
# Start a NixOS machine in the given region.
f = open("ebs-creator-config.nix", "w")
f.write('''{{
resources.ec2KeyPairs.keypair.accessKeyId = "lb-nixos";
resources.ec2KeyPairs.keypair.region = "{0}";
machine =
{{ pkgs, ... }}:
{{
deployment.ec2.accessKeyId = "lb-nixos";
deployment.ec2.region = "{0}";
deployment.ec2.blockDeviceMapping."/dev/xvdg".size = pkgs.lib.mkOverride 10 {1};
}};
}}
'''.format(args.region, ebs_size))
f.close()
db = StateFile(get_default_state_file())
try:
depl = db.open_deployment("ebs-creator")
except Exception:
depl = db.create_deployment()
depl.name = "ebs-creator"
depl.logger.set_autoresponse("y")
depl.nix_exprs = [os.path.abspath("./ebs-creator.nix"), os.path.abspath("./ebs-creator-config.nix")]
if not args.keep: depl.destroy_resources()
depl.deploy(allow_reboot=True)
m = depl.machines['machine']
# Do the installation.
device="/dev/xvdg"
if args.hvm:
m.run_command('parted -s /dev/xvdg -- mklabel msdos')
m.run_command('parted -s /dev/xvdg -- mkpart primary ext2 1M -1s')
device="/dev/xvdg1"
m.run_command("if mountpoint -q /mnt; then umount /mnt; fi")
m.run_command("mkfs.ext4 -L nixos {0}".format(device))
m.run_command("mkdir -p /mnt")
m.run_command("mount {0} /mnt".format(device))
m.run_command("touch /mnt/.ebs")
m.run_command("mkdir -p /mnt/etc/nixos")
m.run_command("nix-channel --add https://nixos.org/channels/nixos-{} nixos".format(args.channel))
m.run_command("nix-channel --update")
version = m.run_command("nix-instantiate --eval-only -A lib.nixpkgsVersion '<nixpkgs>'", capture_stdout=True).split(' ')[0].replace('"','').strip()
print >> sys.stderr, "NixOS version is {0}".format(version)
if args.hvm:
m.upload_file("./amazon-base-config.nix", "/mnt/etc/nixos/amazon-base-config.nix")
m.upload_file("./amazon-hvm-config.nix", "/mnt/etc/nixos/configuration.nix")
m.upload_file("./amazon-hvm-install-config.nix", "/mnt/etc/nixos/amazon-hvm-install-config.nix")
m.run_command("NIXOS_CONFIG=/etc/nixos/amazon-hvm-install-config.nix nixos-install")
else:
m.upload_file("./amazon-base-config.nix", "/mnt/etc/nixos/configuration.nix")
m.run_command("nixos-install")
m.run_command("umount /mnt")
if args.hvm:
ami_name = "nixos-{0}-x86_64-hvm".format(version)
description = "NixOS {0} (x86_64; EBS root; hvm)".format(version)
else:
ami_name = "nixos-{0}-x86_64-ebs".format(version)
description = "NixOS {0} (x86_64; EBS root)".format(version)
# Wait for the snapshot to finish.
def check():
status = snapshot.update()
print >> sys.stderr, "snapshot status is {0}".format(status)
return status == '100%'
m.connect()
volume = m._conn.get_all_volumes([], filters={'attachment.instance-id': m.resource_id, 'attachment.device': "/dev/sdg"})[0]
# Create a snapshot.
snapshot = volume.create_snapshot(description=description)
print >> sys.stderr, "created snapshot {0}".format(snapshot.id)
nixops.util.check_wait(check, max_tries=120)
m._conn.create_tags([snapshot.id], {'Name': ami_name})
if not args.keep: depl.destroy_resources()
# Register the image.
aki = m._conn.get_all_images(filters={'manifest-location': 'ec2*pv-grub-hd0_1.03-x86_64*'})[0]
print >> sys.stderr, "using kernel image {0} - {1}".format(aki.id, aki.location)
block_map = BlockDeviceMapping()
block_map[root_block] = BlockDeviceType(snapshot_id=snapshot.id, delete_on_termination=True, size=ebs_size, volume_type="gp2")
block_map['/dev/sdb'] = BlockDeviceType(ephemeral_name="ephemeral0")
block_map['/dev/sdc'] = BlockDeviceType(ephemeral_name="ephemeral1")
block_map['/dev/sdd'] = BlockDeviceType(ephemeral_name="ephemeral2")
block_map['/dev/sde'] = BlockDeviceType(ephemeral_name="ephemeral3")
common_args = dict(
name=ami_name,
description=description,
architecture="x86_64",
root_device_name=root_block,
block_device_map=block_map,
virtualization_type=virtualization_type,
delete_root_volume_on_termination=True
)
if not args.hvm:
common_args['kernel_id']=aki.id
ami_id = m._conn.register_image(**common_args)
print >> sys.stderr, "registered AMI {0}".format(ami_id)
print >> sys.stderr, "sleeping a bit..."
time.sleep(30)
print >> sys.stderr, "setting image name..."
m._conn.create_tags([ami_id], {'Name': ami_name})
print >> sys.stderr, "making image public..."
image = m._conn.get_all_images(image_ids=[ami_id])[0]
image.set_launch_permissions(user_ids=[], group_names=["all"])
# Do a test deployment to make sure that the AMI works.
f = open("ebs-test.nix", "w")
f.write(
'''
{{
network.description = "NixOS EBS test";
resources.ec2KeyPairs.keypair.accessKeyId = "lb-nixos";
resources.ec2KeyPairs.keypair.region = "{0}";
machine = {{ config, pkgs, resources, ... }}: {{
deployment.targetEnv = "ec2";
deployment.ec2.accessKeyId = "lb-nixos";
deployment.ec2.region = "{0}";
deployment.ec2.instanceType = "{2}";
deployment.ec2.keyPair = resources.ec2KeyPairs.keypair.name;
deployment.ec2.securityGroups = [ "public-ssh" ];
deployment.ec2.ami = "{1}";
}};
}}
'''.format(args.region, ami_id, instance_type))
f.close()
test_depl = db.create_deployment()
test_depl.auto_response = "y"
test_depl.name = "ebs-creator-test"
test_depl.nix_exprs = [os.path.abspath("./ebs-test.nix")]
test_depl.deploy(create_only=True)
test_depl.machines['machine'].run_command("nixos-version")
# Log the AMI ID.
f = open("ec2-amis.nix".format(args.region, image_type), "w")
f.write("{\n")
for dest in [ 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-central-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'sa-east-1']:
copy_image = None
if args.region != dest:
try:
print >> sys.stderr, "copying image from region {0} to {1}".format(args.region, dest)
conn = boto.ec2.connect_to_region(dest)
copy_image = conn.copy_image(args.region, ami_id, ami_name, description=None, client_token=None)
except :
print >> sys.stderr, "FAILED!"
# Log the AMI ID.
if copy_image != None:
f.write(' "{0}"."{1}".{2} = "{3}";\n'.format(args.channel,dest,"hvm" if args.hvm else "ebs",copy_image.image_id))
else:
f.write(' "{0}"."{1}".{2} = "{3}";\n'.format(args.channel,args.region,"hvm" if args.hvm else "ebs",ami_id))
f.write("}\n")
f.close()
if not args.keep:
test_depl.logger.set_autoresponse("y")
test_depl.destroy_resources()
test_depl.delete()

View File

@ -1,53 +0,0 @@
#! /bin/sh -e
export NIXOS_CONFIG=$(dirname $(readlink -f $0))/amazon-base-config.nix
version=$(nix-instantiate --eval-only '<nixpkgs/nixos>' -A config.system.nixosVersion | sed s/'"'//g)
echo "NixOS version is $version"
buildAndUploadFor() {
system="$1"
arch="$2"
echo "building $system image..."
nix-build '<nixpkgs/nixos>' \
-A config.system.build.amazonImage --argstr system "$system" -o ec2-ami
ec2-bundle-image -i ./ec2-ami/nixos.img --user "$AWS_ACCOUNT" --arch "$arch" \
-c "$EC2_CERT" -k "$EC2_PRIVATE_KEY"
for region in eu-west-1; do
echo "uploading $system image for $region..."
name=nixos-$version-$arch-s3
bucket="$(echo $name-$region | tr '[A-Z]_' '[a-z]-')"
if [ "$region" = eu-west-1 ]; then s3location=EU;
elif [ "$region" = us-east-1 ]; then s3location=US;
else s3location="$region"
fi
ec2-upload-bundle -b "$bucket" -m /tmp/nixos.img.manifest.xml \
-a "$EC2_ACCESS_KEY" -s "$EC2_SECRET_KEY" --location "$s3location" \
--url http://s3.amazonaws.com
kernel=$(ec2-describe-images -o amazon --filter "manifest-location=*pv-grub-hd0_1.04-$arch*" --region "$region" | cut -f 2)
echo "using PV-GRUB kernel $kernel"
ami=$(ec2-register "$bucket/nixos.img.manifest.xml" -n "$name" -d "NixOS $system r$revision" -O "$EC2_ACCESS_KEY" -W "$EC2_SECRET_KEY" \
--region "$region" --kernel "$kernel" | cut -f 2)
echo "AMI ID is $ami"
echo " \"14.12\".\"$region\".s3 = \"$ami\";" >> ec2-amis.nix
ec2-modify-image-attribute --region "$region" "$ami" -l -a all -O "$EC2_ACCESS_KEY" -W "$EC2_SECRET_KEY"
for cp_region in us-east-1 us-west-1 us-west-2 eu-central-1 ap-southeast-1 ap-southeast-2 ap-northeast-1 sa-east-1; do
new_ami=$(aws ec2 copy-image --source-image-id $ami --source-region $region --region $cp_region --name "$name" | json ImageId)
echo " \"14.12\".\"$cp_region\".s3 = \"$new_ami\";" >> ec2-amis.nix
done
done
}
buildAndUploadFor x86_64-linux x86_64

View File

@ -1,13 +0,0 @@
{
network.description = "NixOS EBS creator";
machine =
{ config, pkgs, resources, ... }:
{ deployment.targetEnv = "ec2";
deployment.ec2.instanceType = "c3.large";
deployment.ec2.securityGroups = [ "public-ssh" ];
deployment.ec2.ebsBoot = false;
deployment.ec2.keyPair = resources.ec2KeyPairs.keypair.name;
environment.systemPackages = [ pkgs.parted ];
};
}

View File

@ -31,6 +31,7 @@ with lib;
pkgs.xorg.fontbh100dpi
pkgs.xorg.fontmiscmisc
pkgs.xorg.fontcursormisc
pkgs.unifont
];
};

View File

@ -39,6 +39,16 @@ in
'';
};
networking.extraResolvconfConf = lib.mkOption {
type = types.lines;
default = "";
example = "libc=NO";
description = ''
Extra configuration to append to <filename>resolvconf.conf</filename>.
'';
};
networking.proxy = {
default = lib.mkOption {
@ -150,6 +160,7 @@ in
'' + optionalString dnsmasqResolve ''
dnsmasq_conf=/etc/dnsmasq-conf.conf
dnsmasq_resolv=/etc/dnsmasq-resolv.conf
'' + cfg.extraResolvconfConf + ''
'';
} // (optionalAttrs config.services.resolved.enable (

View File

@ -57,8 +57,8 @@ in
type = types.attrsOf (types.listOf types.str);
example = { PATH = [ "/bin" "/sbin" ]; MANPATH = [ "/man" "/share/man" ]; };
description = ''
Attribute set of environment variable. Each attribute maps to a list
of relative paths. Each relative path is appended to the each profile
Attribute set of environment variable. Each attribute maps to a list
of relative paths. Each relative path is appended to the each profile
of <option>environment.profiles</option> to form the content of the
corresponding environment variable.
'';
@ -123,6 +123,7 @@ in
"''${pkgs.dash}/bin/dash"
'';
type = types.path;
visible = false;
description = ''
The shell executable that is linked system-wide to
<literal>/bin/sh</literal>. Please note that NixOS assumes all

View File

@ -33,7 +33,7 @@ in
echo "unpacking the NixOS/Nixpkgs sources..."
mkdir -p /nix/var/nix/profiles/per-user/root
${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \
-i ${channelSources} --quiet --option use-substitutes false
-i ${channelSources} --quiet --option build-use-substitutes false
mkdir -m 0700 -p /root/.nix-defexpr
ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
mkdir -m 0755 -p /var/lib/nixos

View File

@ -36,7 +36,6 @@ in
askPassword = mkOption {
type = types.str;
default = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";
description = ''Program used by SSH to ask for passwords.'';
};
@ -223,5 +222,7 @@ in
export SSH_ASKPASS=${askPassword}
'';
programs.ssh.askPassword = mkDefault "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass";
};
}

View File

@ -99,7 +99,6 @@ in
};
outputTheme = mkOption {
default = "${pkgs.venus}/themes/classic_fancy";
type = types.path;
description = ''
Directory containing a config.ini file which is merged with this one.
@ -170,5 +169,7 @@ in
startAt = cfg.dates;
};
services.venus.outputTheme = mkDefault "${pkgs.venus}/themes/classic_fancy";
};
}

View File

@ -32,7 +32,6 @@ in {
'';
};
configurationDir = mkOption {
default = "${activemq}/conf";
description = ''
The base directory for ActiveMQ's configuration.
By default, this directory is searched for a file named activemq.xml,
@ -126,6 +125,8 @@ in {
'';
};
services.activemq.configurationDir = mkDefault "${activemq}/conf";
};
}

View File

@ -36,7 +36,6 @@ in
hardware.sane.configDir = mkOption {
type = types.string;
default = "${saneConfig}/etc/sane.d";
description = "The value of SANE_CONFIG_DIR.";
};
@ -47,6 +46,8 @@ in
config = mkIf config.hardware.sane.enable {
hardware.sane.configDir = mkDefault "${saneConfig}/etc/sane.d";
environment.systemPackages = backends;
environment.sessionVariables = {
SANE_CONFIG_DIR = config.hardware.sane.configDir;

View File

@ -84,10 +84,10 @@ in
type = types.lines;
default = ''stdin { type => "example" }'';
description = "Logstash input configuration.";
example = ''
example = literalExample ''
# Read from journal
pipe {
command => "${pkgs.systemd}/bin/journalctl -f -o json"
command => "''${pkgs.systemd}/bin/journalctl -f -o json"
type => "syslog" codec => json {}
}
'';

View File

@ -80,7 +80,6 @@ in
services.nixosManual.browser = mkOption {
type = types.path;
default = "${pkgs.w3m}/bin/w3m";
description = ''
Browser used to show the manual.
'';
@ -93,7 +92,7 @@ in
system.build.manual = manual;
environment.systemPackages = [ manual.manpages help ];
environment.systemPackages = [ manual.manpages manual.manual help ];
boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"];
@ -116,6 +115,8 @@ in
services.mingetty.helpLine = mkIf cfg.showManual
"\nPress <Alt-F${toString cfg.ttyNumber}> for the NixOS manual.";
services.nixosManual.browser = mkDefault "${pkgs.w3m}/bin/w3m";
};
}

View File

@ -97,7 +97,6 @@ in
transcoders = mkOption {
type = types.listOf types.path;
default = [ "${pkgs.ffmpeg}/bin/ffmpeg" ];
description = ''
List of paths to transcoder executables that should be accessible
from Subsonic. Symlinks will be created to each executable inside
@ -153,5 +152,8 @@ in
};
users.extraGroups.subsonic.gid = config.ids.gids.subsonic;
services.subsonic.transcoders = mkDefault [ "${pkgs.ffmpeg}/bin/ffmpeg" ];
};
}

View File

@ -200,7 +200,6 @@ in {
staticRootPath = mkOption {
description = "Root path for static assets.";
default = "${cfg.package.out}/share/go/src/github.com/grafana/grafana/public";
type = types.str;
};
@ -311,7 +310,7 @@ in {
config = mkIf cfg.enable {
warnings = [
"Grafana passwords will be stored as plaintext in nix store!"
"Grafana passwords will be stored as plaintext in the Nix store!"
];
systemd.services.grafana = {
@ -331,5 +330,8 @@ in {
home = cfg.dataDir;
createHome = true;
};
services.grafana.staticRootPath = mkDefault "${cfg.package.out}/share/go/src/github.com/grafana/grafana/public";
};
}

View File

@ -24,6 +24,8 @@ let
pid-file "/var/run/named/named.pid";
};
${cfg.extraConfig}
${ concatMapStrings
({ name, file, master ? true, slaves ? [], masters ? [] }:
''
@ -110,6 +112,13 @@ in
}];
};
extraConfig = mkOption {
default = "";
description = "
Extra lines to be added verbatim to the generated named configuration file.
";
};
configFile = mkOption {
default = confFile;
description = "

View File

@ -18,6 +18,7 @@ let
map (i: i.name) (filter (i: if i.useDHCP != null then !i.useDHCP else i.ip4 != [ ] || i.ipAddress != null) interfaces)
++ mapAttrsToList (i: _: i) config.networking.sits
++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bridges))
++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.vswitches))
++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bonds))
++ config.networking.dhcpcd.denyInterfaces;

View File

@ -52,10 +52,7 @@ in
default = "opendns";
type = types.nullOr types.string;
description = ''
The name of the upstream DNSCrypt resolver to use. See
<literal>${resolverListFile}</literal> for alternative resolvers
(e.g., if you are concerned about logging and/or server
location).
The name of the upstream DNSCrypt resolver to use.
'';
};
customResolver = mkOption {

View File

@ -33,7 +33,7 @@ in
type = types.str;
description = "
The Seeks server configuration. If it is not specified,
a default configuration is used (${seeks}/etc/seeks).
a default configuration is used.
";
};

View File

@ -54,12 +54,15 @@ in
description = "Syncthing service";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment.STNORESTART = "placeholder"; # do not self-restart
environment.STNORESTART = "yes"; # do not self-restart
environment.STNOUPGRADE = "yes";
serviceConfig = {
User = "${cfg.user}";
PermissionsStartOnly = true;
Restart = "always";
Restart = "on-failure";
ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -home=${cfg.dataDir}";
SuccessExitStatus = "2 3 4";
RestartForceExitStatus="3 4";
};
};

View File

@ -44,8 +44,7 @@ in {
phpIni = mkOption {
type = types.path;
default = "${cfg.phpPackage}/etc/php-recommended.ini";
description = "php.ini file to use.";
description = "PHP configuration file to use.";
};
poolConfigs = mkOption {
@ -86,5 +85,7 @@ in {
};
};
services.phpfpm.phpIni = mkDefault "${cfg.phpPackage}/etc/php-recommended.ini";
};
}

View File

@ -114,6 +114,10 @@ let
rm -rf $HOME/.compose-cache
mkdir $HOME/.compose-cache
# Work around KDE errors when a user first logs in and
# .local/share doesn't exist yet.
mkdir -p $HOME/.local/share
${cfg.displayManager.sessionCommands}
# Allow the user to execute commands at the beginning of the X session.

View File

@ -104,7 +104,6 @@ in
};
background = mkOption {
default = "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png";
description = ''
The background image or color to use.
'';
@ -172,5 +171,8 @@ in
};
users.extraGroups.lightdm.gid = config.ids.gids.lightdm;
services.xserver.displayManager.lightdm.background = mkDefault "${pkgs.nixos-artwork}/share/artwork/gnome/Gnome_Dark.png";
};
}

View File

@ -135,7 +135,7 @@ ln -s @modulesClosure@/lib/modules /lib/modules
echo @extraUtils@/bin/modprobe > /proc/sys/kernel/modprobe
for i in @kernelModules@; do
echo "loading module $(basename $i)..."
modprobe $i || true
modprobe $i
done
@ -146,7 +146,7 @@ ln -sfn @udevRules@ /etc/udev/rules.d
mkdir -p /dev/.mdadm
systemd-udevd --daemon
udevadm trigger --action=add
udevadm settle || true
udevadm settle
# Load boot-time keymap before any LVM/LUKS initialization
@ -290,10 +290,23 @@ mountFS() {
if [ -z "$fsType" ]; then fsType=auto; fi
fi
echo "$device /mnt-root$mountPoint $fsType $options" >> /etc/fstab
# Filter out x- options, which busybox doesn't do yet.
local optionsFiltered="$(IFS=,; for i in $options; do if [ "${i:0:2}" != "x-" ]; then echo -n $i,; fi; done)"
echo "$device /mnt-root$mountPoint $fsType $optionsFiltered" >> /etc/fstab
checkFS "$device" "$fsType"
# Optionally resize the filesystem.
case $options in
*x-nixos.autoresize*)
if [ "$fsType" = ext2 -o "$fsType" = ext3 -o "$fsType" = ext4 ]; then
echo "resizing $device..."
resize2fs "$device"
fi
;;
esac
# Create backing directories for unionfs-fuse.
if [ "$fsType" = unionfs-fuse ]; then
for i in $(IFS=:; echo ${options##*,dirs=}); do
@ -303,7 +316,7 @@ mountFS() {
echo "mounting $device on $mountPoint..."
mkdir -p "/mnt-root$mountPoint" || true
mkdir -p "/mnt-root$mountPoint"
# For CIFS mounts, retry a few times before giving up.
local n=0
@ -375,7 +388,7 @@ while read -u 3 mountPoint; do
# Wait once more for the udev queue to empty, just in case it's
# doing something with $device right now.
udevadm settle || true
udevadm settle
mountFS "$device" "$mountPoint" "$options" "$fsType"
done
@ -388,9 +401,9 @@ exec 3>&-
# Emit a udev rule for /dev/root to prevent systemd from complaining.
if [ -e /mnt-root/iso ]; then
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/mnt-root/iso || true)
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/mnt-root/iso)
else
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot || true)
eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot)
fi
if [ "$ROOT_MAJOR" -a "$ROOT_MINOR" -a "$ROOT_MAJOR" != 0 ]; then
mkdir -p /run/udev/rules.d
@ -399,7 +412,7 @@ fi
# Stop udevd.
udevadm control --exit || true
udevadm control --exit
# Kill any remaining processes, just to be sure we're not taking any
# with us into stage 2. But keep storage daemons like unionfs-fuse.

View File

@ -70,6 +70,12 @@ let
copy_bin_and_libs ${pkgs.kmod}/bin/kmod
ln -sf kmod $out/bin/modprobe
# Copy resize2fs if needed.
${optionalString (any (fs: fs.autoResize) (attrValues config.fileSystems)) ''
# We need mke2fs in the initrd.
copy_bin_and_libs ${pkgs.e2fsprogs}/sbin/resize2fs
''}
${config.boot.initrd.extraUtilsCommands}
# Copy ld manually since it isn't detected correctly
@ -393,7 +399,6 @@ in
}
];
system.build.bootStage1 = bootStage1;
system.build.initialRamdisk = initialRamdisk;
system.build.extraUtils = extraUtils;

View File

@ -6,6 +6,7 @@ let
fileSystems = attrValues config.fileSystems ++ config.swapDevices;
encDevs = filter (dev: dev.encrypted.enable) fileSystems;
keyedEncDevs = filter (dev: dev.encrypted.keyFile != null) encDevs;
keylessEncDevs = filter (dev: dev.encrypted.keyFile == null) encDevs;
isIn = needle: haystack: filter (p: p == needle) haystack != [];
anyEncrypted =
fold (j: v: v || j.encrypted.enable) false encDevs;
@ -29,15 +30,15 @@ let
label = mkOption {
default = null;
example = "rootfs";
type = types.nullOr types.str;
description = "Label of the backing encrypted device.";
type = types.uniq (types.nullOr types.str);
description = "Label of the unlocked encrypted device. Set <literal>fileSystems.&lt;name?&gt;.device</literal> to <literal>/dev/mapper/&lt;label&gt;</literal> to mount the unlocked device.";
};
keyFile = mkOption {
default = null;
example = "/root/.swapkey";
type = types.nullOr types.str;
description = "File system location of keyfile.";
description = "File system location of keyfile. This unlocks the drive after the root has been mounted to <literal>/mnt-root</literal>.";
};
};
};
@ -58,11 +59,11 @@ in
boot.initrd = {
luks = {
devices =
map (dev: { name = dev.encrypted.label; device = dev.encrypted.blkDev; } ) encDevs;
map (dev: { name = dev.encrypted.label; device = dev.encrypted.blkDev; } ) keylessEncDevs;
cryptoModules = [ "aes" "sha256" "sha1" "xts" ];
};
postMountCommands =
concatMapStrings (dev: "cryptsetup luksOpen --key-file ${dev.encrypted.keyFile} ${dev.encrypted.label};\n") keyedEncDevs;
concatMapStrings (dev: "cryptsetup luksOpen --key-file ${dev.encrypted.keyFile} ${dev.encrypted.blkDev} ${dev.encrypted.label};\n") keyedEncDevs;
};
};
}

View File

@ -7,7 +7,7 @@ let
fileSystems = attrValues config.fileSystems;
prioOption = prio: optionalString (prio !=null) " pri=${toString prio}";
prioOption = prio: optionalString (prio != null) " pri=${toString prio}";
fileSystemOpts = { name, config, ... }: {
@ -41,9 +41,9 @@ let
};
options = mkOption {
default = "defaults,relatime";
default = "defaults";
example = "data=journal";
type = types.commas;
type = types.commas; # FIXME: should be a list
description = "Options used to mount the file system.";
};
@ -58,6 +58,17 @@ let
'';
};
autoResize = mkOption {
default = false;
type = types.bool;
description = ''
If set, the filesystem is grown to its maximum size before
being mounted. (This is typically the size of the containing
partition.) This is currently only supported for ext2/3/4
filesystems that are mounted during early boot.
'';
};
noCheck = mkOption {
default = false;
type = types.bool;
@ -69,8 +80,7 @@ let
config = {
mountPoint = mkDefault name;
device = mkIf (config.fsType == "tmpfs") (mkDefault config.fsType);
# The vboxsf filesystem doesn't support the relatime option:
options = mkIf (config.fsType == "vboxsf") (mkDefault "defaults");
options = mkIf config.autoResize "x-nixos.autoresize";
};
};

View File

@ -21,9 +21,9 @@ let
kernel = config.boot.kernelPackages;
splKernelPkg = if cfgZfs.useGit then kernel.spl_git else kernel.spl;
zfsKernelPkg = if cfgZfs.useGit then kernel.zfs_git else kernel.zfs;
zfsUserPkg = if cfgZfs.useGit then pkgs.zfs_git else pkgs.zfs;
splKernelPkg = kernel.spl;
zfsKernelPkg = kernel.zfs;
zfsUserPkg = pkgs.zfs;
autosnapPkg = pkgs.zfstools.override {
zfs = zfsUserPkg;
@ -53,16 +53,6 @@ in
options = {
boot.zfs = {
useGit = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Use the git version of the SPL and ZFS packages.
Note that these are unreleased versions, with less testing, and therefore
may be more unstable.
'';
};
extraPools = mkOption {
type = types.listOf types.str;

View File

@ -220,6 +220,45 @@ in
'';
});
createVswitchDevice = n: v: nameValuePair "${n}-netdev"
(let
managedInterfaces = filter (x: hasAttr x cfg.interfaces) v.interfaces;
managedInterfaceServices = concatMap (i: [ "network-addresses-${i}.service" "network-link-${i}.service" ]) managedInterfaces;
virtualInterfaces = filter (x: (hasAttr x cfg.interfaces) && cfg.interfaces.${x}.virtual) v.interfaces;
virtualInterfaceServices = concatMap (i: [ "${i}-netdev.service" ]) virtualInterfaces;
deps = map subsystemDevice v.interfaces;
ofRules = pkgs.writeText "vswitch-${n}-openFlowRules" v.openFlowRules;
in
{ description = "Open vSwitch Interface ${n}";
wantedBy = [ "network.target" "vswitchd.service" (subsystemDevice n) ];
requires = optionals v.bindInterfaces (deps ++ managedInterfaceServices ++ virtualInterfaceServices);
requiredBy = optionals v.bindInterfaces (managedInterfaceServices ++ virtualInterfaceServices);
bindsTo = deps ++ [ "vswitchd.service" ];
partOf = [ "vswitchd.service" ];
after = [ "network-pre.target" "vswitchd.service" ] ++ deps ++ managedInterfaceServices ++ virtualInterfaceServices;
before = [ "network-interfaces.target" (subsystemDevice n) ];
serviceConfig.Type = "oneshot";
serviceConfig.RemainAfterExit = true;
path = [ pkgs.iproute config.virtualisation.vswitch.package ];
script = ''
echo "Removing old Open vSwitch ${n}..."
ovs-vsctl --if-exists del-br ${n}
echo "Adding Open vSwitch ${n}..."
ovs-vsctl -- add-br ${n} ${concatMapStrings (i: " -- add-port ${n} ${i}") v.interfaces} \
${concatMapStrings (x: " -- set-controller ${n} " + x) v.controllers} \
${concatMapStrings (x: " -- " + x) (splitString "\n" v.extraOvsctlCmds)}
echo "Adding OpenFlow rules for Open vSwitch ${n}..."
ovs-ofctl add-flows ${n} ${ofRules}
'';
postStop = ''
ip link set ${n} down || true
ovs-ofctl del-flows ${n} || true
ovs-vsctl --if-exists del-br ${n}
'';
});
createBondDevice = n: v: nameValuePair "${n}-netdev"
(let
deps = map subsystemDevice v.interfaces;
@ -335,6 +374,7 @@ in
map configureAddrs interfaces ++
map createTunDevice (filter (i: i.virtual) interfaces))
// mapAttrs' createBridgeDevice cfg.bridges
// mapAttrs' createVswitchDevice cfg.vswitches
// mapAttrs' createBondDevice cfg.bonds
// mapAttrs' createMacvlanDevice cfg.macvlans
// mapAttrs' createSitDevice cfg.sits

View File

@ -35,6 +35,9 @@ in
assertions = [ {
assertion = cfg.defaultGatewayWindowSize == null;
message = "networking.defaultGatewayWindowSize is not supported by networkd.";
} {
assertion = cfg.vswitches == {};
message = "networking.vswichtes are not supported by networkd.";
} ] ++ flip mapAttrsToList cfg.bridges (n: { rstp, ... }: {
assertion = !rstp;
message = "networking.bridges.${n}.rstp is not supported by networkd.";

View File

@ -12,7 +12,8 @@ let
hasBonds = cfg.bonds != { };
slaves = concatMap (i: i.interfaces) (attrValues cfg.bonds)
++ concatMap (i: i.interfaces) (attrValues cfg.bridges);
++ concatMap (i: i.interfaces) (attrValues cfg.bridges)
++ concatMap (i: i.interfaces) (attrValues cfg.vswitches);
slaveIfs = map (i: cfg.interfaces.${i}) (filter (i: cfg.interfaces ? ${i}) slaves);
@ -371,6 +372,81 @@ in
options = [ interfaceOpts ];
};
networking.vswitches = mkOption {
default = { };
example =
{ vs0.interfaces = [ "eth0" "eth1" ];
vs1.interfaces = [ "eth2" "wlan0" ];
};
description =
''
This option allows you to define Open vSwitches that connect
physical networks together. The value of this option is an
attribute set. Each attribute specifies a vswitch, with the
attribute name specifying the name of the vswitch's network
interface.
'';
type = types.attrsOf types.optionSet;
options = {
interfaces = mkOption {
example = [ "eth0" "eth1" ];
type = types.listOf types.str;
description =
"The physical network interfaces connected by the vSwitch.";
};
bindInterfaces = mkOption {
type = types.bool;
default = false;
description = ''
If true, then the interfaces of the vSwitch are brought 'up' and especially
also 'down' together with the vSwitch. That requires that every interfaces
is configured as a systemd network services.
'';
};
controllers = mkOption {
type = types.listOf types.str;
default = [];
example = [ "ptcp:6653:[::1]" ];
description = ''
Specify the controller targets. For the allowed options see <literal>man 8 ovs-vsctl</literal>.
'';
};
openFlowRules = mkOption {
type = types.lines;
default = "";
example = ''
actions=normal
'';
description = ''
OpenFlow rules to insert into the Open vSwitch. All <literal>openFlowRules</literal> are
loaded with <literal>ovs-ofctl</literal> within one atomic operation.
'';
};
extraOvsctlCmds = mkOption {
type = types.lines;
default = "";
example = ''
set-fail-mode <switch_name> secure
set Bridge <switch_name> stp_enable=true
'';
description = ''
Commands to manipulate the Open vSwitch database. Every line executed with <literal>ovs-vsctl</literal>.
All commands are bundled together with the operations for adding the interfaces
into one atomic operation.
'';
};
};
};
networking.bridges = mkOption {
default = { };
example =
@ -766,6 +842,8 @@ in
services.mstpd = mkIf needsMstpd { enable = true; };
virtualisation.vswitch = mkIf (cfg.vswitches != { }) { enable = true; };
};
}

View File

@ -1,3 +0,0 @@
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
}

View File

@ -0,0 +1,50 @@
# This module automatically grows the root partition on Amazon EC2 HVM
# instances. This allows an instance to be created with a bigger root
# filesystem than provided by the AMI.
{ config, lib, pkgs, ... }:
with lib;
let
growpart = pkgs.stdenv.mkDerivation {
name = "growpart";
src = pkgs.fetchurl {
url = "https://launchpad.net/cloud-utils/trunk/0.27/+download/cloud-utils-0.27.tar.gz";
sha256 = "16shlmg36lidp614km41y6qk3xccil02f5n3r4wf6d1zr5n4v8vd";
};
patches = [ ./growpart-util-linux-2.26.patch ];
buildPhase = ''
cp bin/growpart $out
sed -i 's|awk|gawk|' $out
sed -i 's|sed|gnused|' $out
'';
dontInstall = true;
dontPatchShebangs = true;
};
in
{
config = mkIf config.ec2.hvm {
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.gawk}/bin/gawk
copy_bin_and_libs ${pkgs.gnused}/bin/sed
copy_bin_and_libs ${pkgs.utillinux}/sbin/sfdisk
cp -v ${growpart} $out/bin/growpart
ln -s sed $out/bin/gnused
'';
boot.initrd.postDeviceCommands = ''
if [ -e /dev/xvda ] && [ -e /dev/xvda1 ]; then
TMPDIR=/run sh $(type -P growpart) /dev/xvda 1
udevadm settle
fi
'';
};
}

View File

@ -1,105 +1,40 @@
# Configuration for Amazon EC2 instances. (Note that this file is a
# misnomer - it should be "amazon-config.nix" or so, not
# "amazon-image.nix", since it's used not only to build images but
# also to reconfigure instances. However, we can't rename it because
# existing "configuration.nix" files on EC2 instances refer to it.)
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.ec2;
in
let cfg = config.ec2; in
{
imports = [ ../profiles/headless.nix ./ec2-data.nix ];
imports = [ ../profiles/headless.nix ./ec2-data.nix ./amazon-grow-partition.nix ];
config = {
system.build.amazonImage =
pkgs.vmTools.runInLinuxVM (
pkgs.runCommand "amazon-image"
{ preVM =
''
mkdir $out
diskImage=$out/nixos.img
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage "8G"
mv closure xchg/
'';
buildInputs = [ pkgs.utillinux pkgs.perl ];
exportReferencesGraph =
[ "closure" config.system.build.toplevel ];
}
''
${if cfg.hvm then ''
# Create a single / partition.
${pkgs.parted}/sbin/parted /dev/vda mklabel msdos
${pkgs.parted}/sbin/parted /dev/vda -- mkpart primary ext2 1M -1s
. /sys/class/block/vda1/uevent
mknod /dev/vda1 b $MAJOR $MINOR
# Create an empty filesystem and mount it.
${pkgs.e2fsprogs}/sbin/mkfs.ext4 -L nixos /dev/vda1
${pkgs.e2fsprogs}/sbin/tune2fs -c 0 -i 0 /dev/vda1
mkdir /mnt
mount /dev/vda1 /mnt
'' else ''
# Create an empty filesystem and mount it.
${pkgs.e2fsprogs}/sbin/mkfs.ext4 -L nixos /dev/vda
${pkgs.e2fsprogs}/sbin/tune2fs -c 0 -i 0 /dev/vda
mkdir /mnt
mount /dev/vda /mnt
''}
# The initrd expects these directories to exist.
mkdir /mnt/dev /mnt/proc /mnt/sys
mount -o bind /proc /mnt/proc
mount -o bind /dev /mnt/dev
mount -o bind /sys /mnt/sys
# Copy all paths in the closure to the filesystem.
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
mkdir -p /mnt/nix/store
echo "copying everything (will take a while)..."
cp -prd $storePaths /mnt/nix/store/
# Register the paths in the Nix database.
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
chroot /mnt ${config.nix.package}/bin/nix-store --load-db --option build-users-group ""
# Create the system profile to allow nixos-rebuild to work.
chroot /mnt ${config.nix.package}/bin/nix-env --option build-users-group "" \
-p /nix/var/nix/profiles/system --set ${config.system.build.toplevel}
# `nixos-rebuild' requires an /etc/NIXOS.
mkdir -p /mnt/etc
touch /mnt/etc/NIXOS
# `switch-to-configuration' requires a /bin/sh
mkdir -p /mnt/bin
ln -s ${config.system.build.binsh}/bin/sh /mnt/bin/sh
# Install a configuration.nix.
mkdir -p /mnt/etc/nixos
cp ${./amazon-config.nix} /mnt/etc/nixos/configuration.nix
# Generate the GRUB menu.
ln -s vda /dev/xvda
chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot
umount /mnt/proc /mnt/dev /mnt/sys
umount /mnt
''
);
fileSystems."/".device = "/dev/disk/by-label/nixos";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
};
boot.initrd.kernelModules = [ "xen-blkfront" ];
boot.kernelModules = [ "xen-netfront" ];
boot.kernelParams = mkIf cfg.hvm [ "console=ttyS0" ];
# Prevent the nouveau kernel module from being loaded, as it
# interferes with the nvidia/nvidia-uvm modules needed for CUDA.
boot.blacklistedKernelModules = [ "nouveau" ];
# Also blacklist xen_fbfront to prevent a 30 second delay during
# boot.
boot.blacklistedKernelModules = [ "nouveau" "xen_fbfront" ];
# Generate a GRUB menu. Amazon's pv-grub uses this to boot our kernel/initrd.
boot.loader.grub.version = if cfg.hvm then 2 else 1;
boot.loader.grub.device = if cfg.hvm then "/dev/xvda" else "nodev";
boot.loader.grub.timeout = 0;
boot.loader.grub.extraPerEntryConfig = "root (hd0${lib.optionalString cfg.hvm ",0"})";
boot.loader.grub.extraPerEntryConfig = mkIf (!cfg.hvm) "root (hd0)";
boot.initrd.postDeviceCommands =
''

View File

@ -35,10 +35,8 @@ with lib;
mkdir -m 0700 -p /root/.ssh
$wget http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key > /root/key.pub
if [ $? -eq 0 -a -e /root/key.pub ]; then
if ! grep -q -f /root/key.pub /root/.ssh/authorized_keys; then
cat /root/key.pub >> /root/.ssh/authorized_keys
echo "new key added to authorized_keys"
fi
cat /root/key.pub >> /root/.ssh/authorized_keys
echo "new key added to authorized_keys"
chmod 600 /root/.ssh/authorized_keys
rm -f /root/key.pub
fi
@ -80,8 +78,9 @@ with lib;
# can obtain it securely by parsing the output of
# ec2-get-console-output.
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" > /dev/console
${config.programs.ssh.package}/bin/ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub > /dev/console
${config.programs.ssh.package}/bin/ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub > /dev/console
for i in /etc/ssh/ssh_host_*_key.pub; do
${config.programs.ssh.package}/bin/ssh-keygen -l -f $i > /dev/console
done
echo "-----END SSH HOST KEY FINGERPRINTS-----" > /dev/console
'';
serviceConfig.Type = "oneshot";

View File

@ -0,0 +1,88 @@
From 1895d10a7539d055a4e0206af1e7a9e5ea32a4f7 Mon Sep 17 00:00:00 2001
From: Juerg Haefliger <juerg.haefliger@hp.com>
Date: Wed, 25 Mar 2015 13:59:20 +0100
Subject: [PATCH] Support new sfdisk version 2.26
The sfdisk usage with version 2.26 changed. Specifically, the option
--show-pt-geometry and functionality for CHS have been removed.
Also, restoring a backup MBR now needs to be done using dd.
---
bin/growpart | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/bin/growpart b/bin/growpart
index 595c40b..d4c995b 100755
--- a/bin/growpart
+++ b/bin/growpart
@@ -28,7 +28,6 @@ PART=""
PT_UPDATE=false
DRY_RUN=0
-MBR_CHS=""
MBR_BACKUP=""
GPT_BACKUP=""
_capture=""
@@ -133,7 +132,8 @@ bad_Usage() {
}
mbr_restore() {
- sfdisk --no-reread "${DISK}" ${MBR_CHS} -I "${MBR_BACKUP}"
+ dd if="${MBR_BACKUP}-${DISK#/dev/}-0x00000000.bak" of="${DISK}" bs=1 \
+ conv=notrunc
}
sfdisk_worked_but_blkrrpart_failed() {
@@ -148,34 +148,26 @@ sfdisk_worked_but_blkrrpart_failed() {
mbr_resize() {
RESTORE_HUMAN="${TEMP_D}/recovery"
- MBR_BACKUP="${TEMP_D}/orig.save"
+ MBR_BACKUP="${TEMP_D}/backup"
local change_out=${TEMP_D}/change.out
local dump_out=${TEMP_D}/dump.out
local new_out=${TEMP_D}/new.out
local dump_mod=${TEMP_D}/dump.mod
- local tmp="${TEMP_D}/tmp.out"
- local err="${TEMP_D}/err.out"
- local _devc cyl _w1 heads _w2 sectors _w3 tot dpart
+ local tot dpart
local pt_start pt_size pt_end max_end new_size change_info
- # --show-pt-geometry outputs something like
- # /dev/sda: 164352 cylinders, 4 heads, 32 sectors/track
- rqe sfd_geom sfdisk "${DISK}" --show-pt-geometry >"${tmp}" &&
- read _devc cyl _w1 heads _w2 sectors _w3 <"${tmp}" &&
- MBR_CHS="-C ${cyl} -H ${heads} -S ${sectors}" ||
- fail "failed to get CHS from ${DISK}"
+ tot=$(sfdisk --list "${DISK}" | awk '{ print $(NF-1) ; exit }') ||
+ fail "failed to get total number of sectors from ${DISK}"
- tot=$((${cyl}*${heads}*${sectors}))
+ debug 1 "total number of sectors of ${DISK} is ${tot}"
- debug 1 "geometry is ${MBR_CHS}. total size=${tot}"
- rqe sfd_dump sfdisk ${MBR_CHS} --unit=S --dump "${DISK}" \
+ rqe sfd_dump sfdisk --dump "${DISK}" \
>"${dump_out}" ||
fail "failed to dump sfdisk info for ${DISK}"
-
{
- echo "## sfdisk ${MBR_CHS} --unit=S --dump ${DISK}"
+ echo "## sfdisk --dump ${DISK}"
cat "${dump_out}"
} >"${RESTORE_HUMAN}"
[ $? -eq 0 ] || fail "failed to save sfdisk -d output"
@@ -237,7 +229,7 @@ mbr_resize() {
exit 0
fi
- LANG=C sfdisk --no-reread "${DISK}" ${MBR_CHS} --force \
+ LANG=C sfdisk --no-reread "${DISK}" --force \
-O "${MBR_BACKUP}" <"${new_out}" >"${change_out}" 2>&1
ret=$?
[ $ret -eq 0 ] || RESTORE_FUNC="mbr_restore"
--
2.1.4

View File

@ -19,6 +19,15 @@ in {
'';
};
resetOnStart = mkOption {
type = types.bool;
default = false;
description = ''
Whether to reset the Open vSwitch configuration database to a default
configuration on every start of the systemd <literal>ovsdb.service</literal>.
'';
};
package = mkOption {
type = types.package;
default = pkgs.openvswitch;
@ -75,6 +84,7 @@ in {
mkdir -p ${runDir}
mkdir -p /var/db/openvswitch
chmod +w /var/db/openvswitch
${optionalString cfg.resetOnStart "rm -f /var/db/openvswitch/conf.db"}
if [[ ! -e /var/db/openvswitch/conf.db ]]; then
${cfg.package}/bin/ovsdb-tool create \
"/var/db/openvswitch/conf.db" \
@ -98,6 +108,7 @@ in {
Restart = "always";
RestartSec = 3;
PIDFile = "/var/run/openvswitch/ovsdb.pid";
# Use service type 'forking' to correctly determine when ovsdb-server is ready.
Type = "forking";
};
postStart = ''
@ -118,6 +129,7 @@ in {
--detach
'';
PIDFile = "/var/run/openvswitch/ovs-vswitchd.pid";
# Use service type 'forking' to correctly determine when vswitchd is ready.
Type = "forking";
};
};
@ -147,6 +159,7 @@ in {
unix:/var/run/openvswitch/db.sock
'';
PIDFile = "/var/run/openvswitch/ovs-monitor-ipsec.pid";
# Use service type 'forking' to correctly determine when ovs-monitor-ipsec is ready.
Type = "forking";
};

View File

@ -11,93 +11,37 @@ in {
options = {
virtualbox = {
baseImageSize = mkOption {
type = types.str;
default = "10G";
type = types.int;
default = 10 * 1024;
description = ''
The size of the VirtualBox base image. The size string should be on
a format the qemu-img command accepts.
The size of the VirtualBox base image in MiB.
'';
};
};
};
config = {
system.build.virtualBoxImage =
pkgs.vmTools.runInLinuxVM (
pkgs.runCommand "virtualbox-image"
{ memSize = 768;
preVM =
''
mkdir $out
diskImage=$out/image
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage "${cfg.baseImageSize}"
mv closure xchg/
'';
postVM =
''
echo "creating VirtualBox disk image..."
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -O vdi $diskImage $out/disk.vdi
rm $diskImage
'';
buildInputs = [ pkgs.utillinux pkgs.perl ];
exportReferencesGraph =
[ "closure" config.system.build.toplevel ];
system.build.virtualBoxImage = import ../../lib/make-disk-image.nix {
inherit pkgs lib config;
partitioned = true;
diskSize = cfg.baseImageSize;
configFile = pkgs.writeText "configuration.nix"
''
{
imports = [ <nixpkgs/nixos/modules/virtualisation/virtualbox-image.nix> ];
}
''
# Create a single / partition.
${pkgs.parted}/sbin/parted /dev/vda mklabel msdos
${pkgs.parted}/sbin/parted /dev/vda -- mkpart primary ext2 1M -1s
. /sys/class/block/vda1/uevent
mknod /dev/vda1 b $MAJOR $MINOR
# Create an empty filesystem and mount it.
${pkgs.e2fsprogs}/sbin/mkfs.ext4 -L nixos /dev/vda1
${pkgs.e2fsprogs}/sbin/tune2fs -c 0 -i 0 /dev/vda1
mkdir /mnt
mount /dev/vda1 /mnt
# The initrd expects these directories to exist.
mkdir /mnt/dev /mnt/proc /mnt/sys
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
# Copy all paths in the closure to the filesystem.
storePaths=$(perl ${pkgs.pathsFromGraph} /tmp/xchg/closure)
echo "filling Nix store..."
mkdir -p /mnt/nix/store
set -f
cp -prd $storePaths /mnt/nix/store/
mkdir -p /mnt/etc/nix
echo 'build-users-group = ' > /mnt/etc/nix/nix.conf
# Register the paths in the Nix database.
printRegistration=1 perl ${pkgs.pathsFromGraph} /tmp/xchg/closure | \
chroot /mnt ${config.nix.package}/bin/nix-store --load-db
# Create the system profile to allow nixos-rebuild to work.
chroot /mnt ${config.nix.package}/bin/nix-env \
-p /nix/var/nix/profiles/system --set ${config.system.build.toplevel}
# `nixos-rebuild' requires an /etc/NIXOS.
mkdir -p /mnt/etc/nixos
touch /mnt/etc/NIXOS
# `switch-to-configuration' requires a /bin/sh
mkdir -p /mnt/bin
ln -s ${config.system.build.binsh}/bin/sh /mnt/bin/sh
# Generate the GRUB menu.
ln -s vda /dev/sda
chroot /mnt ${config.system.build.toplevel}/bin/switch-to-configuration boot
umount /mnt/proc /mnt/dev /mnt/sys
umount /mnt
''
);
'';
postVM =
''
echo "creating VirtualBox disk image..."
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -O vdi $diskImage $out/disk.vdi
rm $diskImage
'';
};
system.build.virtualBoxOVA = pkgs.runCommand "virtualbox-ova"
{ buildInputs = [ pkgs.linuxPackages.virtualbox ];
vmName = "NixOS ${config.system.nixosVersion} (${pkgs.stdenv.system})";
@ -118,17 +62,17 @@ in {
VBoxManage storagectl "$vmName" --name SATA --add sata --portcount 4 --bootable on --hostiocache on
VBoxManage storageattach "$vmName" --storagectl SATA --port 0 --device 0 --type hdd \
--medium ${config.system.build.virtualBoxImage}/disk.vdi
echo "exporting VirtualBox VM..."
mkdir -p $out
VBoxManage export "$vmName" --output "$out/$fileName"
'';
fileSystems."/".device = "/dev/disk/by-label/nixos";
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
virtualisation.virtualbox.guest.enable = true;
};
}

View File

@ -220,7 +220,7 @@ in rec {
tests.dockerRegistry = hydraJob (import tests/docker-registry.nix { system = "x86_64-linux"; });
tests.etcd = hydraJob (import tests/etcd.nix { system = "x86_64-linux"; });
tests.ec2-nixops = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-nixops;
tests.ec2-config = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-config;
#tests.ec2-config = hydraJob (import tests/ec2.nix { system = "x86_64-linux"; }).boot-ec2-config;
tests.firefox = callTest tests/firefox.nix {};
tests.firewall = callTest tests/firewall.nix {};
tests.fleet = hydraJob (import tests/fleet.nix { system = "x86_64-linux"; });

View File

@ -9,9 +9,18 @@ let
(import ../lib/eval-config.nix {
inherit system;
modules = [
../maintainers/scripts/ec2/amazon-hvm-config.nix
../maintainers/scripts/ec2/amazon-image.nix
../../nixos/modules/testing/test-instrumentation.nix
{ boot.initrd.kernelModules = [ "virtio" "virtio_blk" "virtio_pci" "virtio_ring" ]; }
{ boot.initrd.kernelModules = [ "virtio" "virtio_blk" "virtio_pci" "virtio_ring" ];
ec2.hvm = true;
# Hack to make the partition resizing work in QEMU.
boot.initrd.postDeviceCommands = mkBefore
''
ln -s vda /dev/xvda
ln -s vda1 /dev/xvda1
'';
}
];
}).config.system.build.amazonImage;
@ -34,41 +43,49 @@ let
nodes = {};
testScript =
''
use File::Temp qw/ tempfile /;
my ($fh, $filename) = tempfile();
my $imageDir = ($ENV{'TMPDIR'} // "/tmp") . "/vm-state-machine";
mkdir $imageDir, 0700;
my $diskImage = "$imageDir/machine.qcow2";
system("qemu-img create -f qcow2 -o backing_file=${image}/nixos.img $diskImage") == 0 or die;
system("qemu-img resize $diskImage 10G") == 0 or die;
`qemu-img create -f qcow2 -o backing_file=${image}/nixos.img $filename`;
my $startCommand = "qemu-kvm -m 768 -net nic -net 'user,net=169.254.0.0/16,guestfwd=tcp:169.254.169.254:80-cmd:${pkgs.micro-httpd}/bin/micro_httpd ${metaData}'";
$startCommand .= " -drive file=" . Cwd::abs_path($filename) . ",if=virtio,werror=report";
# Note: we use net=169.0.0.0/8 rather than
# net=169.254.0.0/16 to prevent dhcpcd from getting horribly
# confused. (It would get a DHCP lease in the 169.254.*
# range, which it would then configure and prompty delete
# again when it deletes link-local addresses.) Ideally we'd
# turn off the DHCP server, but qemu does not have an option
# to do that.
my $startCommand = "qemu-kvm -m 768 -net nic -net 'user,net=169.0.0.0/8,guestfwd=tcp:169.254.169.254:80-cmd:${pkgs.micro-httpd}/bin/micro_httpd ${metaData}'";
$startCommand .= " -drive file=$diskImage,if=virtio,werror=report";
$startCommand .= " \$QEMU_OPTS";
my $machine = createMachine({ startCommand => $startCommand });
${script}
'';
};
snakeOilPrivateKey = [
"-----BEGIN EC PRIVATE KEY-----"
"MHcCAQEEIHQf/khLvYrQ8IOika5yqtWvI0oquHlpRLTZiJy5dRJmoAoGCCqGSM49"
"AwEHoUQDQgAEKF0DYGbBwbj06tA3fd/+yP44cvmwmHBWXZCKbS+RQlAKvLXMWkpN"
"r1lwMyJZoSGgBHoUahoYjTh9/sJL7XLJtA=="
"-----END EC PRIVATE KEY-----"
];
snakeOilPrivateKey = ''
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACDEPmwZv5dDPrMUaq0dDP+6eBTTe+QNrz14KBEIdhHd1QAAAJDufJ4S7nye
EgAAAAtzc2gtZWQyNTUxOQAAACDEPmwZv5dDPrMUaq0dDP+6eBTTe+QNrz14KBEIdhHd1Q
AAAECgwbDlYATM5/jypuptb0GF/+zWZcJfoVIFBG3LQeRyGsQ+bBm/l0M+sxRqrR0M/7p4
FNN75A2vPXgoEQh2Ed3VAAAADEVDMiB0ZXN0IGtleQE=
-----END OPENSSH PRIVATE KEY-----
'';
snakeOilPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMQ+bBm/l0M+sxRqrR0M/7p4FNN75A2vPXgoEQh2Ed3V EC2 test key";
snakeOilPublicKey = pkgs.lib.concatStrings [
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHA"
"yNTYAAABBBChdA2BmwcG49OrQN33f/sj+OHL5sJhwVl2Qim0vkUJQCry1zFpKTa"
"9ZcDMiWaEhoAR6FGoaGI04ff7CS+1yybQ= snakeoil"
];
in {
boot-ec2-nixops = makeEc2Test {
name = "nixops-userdata";
sshPublicKey = snakeOilPublicKey; # That's right folks! My user's key is also the host key!
userData = ''
SSH_HOST_DSA_KEY_PUB:${snakeOilPublicKey}
SSH_HOST_DSA_KEY:${pkgs.lib.concatStringsSep "|" snakeOilPrivateKey}
SSH_HOST_ED25519_KEY_PUB:${snakeOilPublicKey}
SSH_HOST_ED25519_KEY:${replaceStrings ["\n"] ["|"] snakeOilPrivateKey}
'';
script = ''
$machine->start;
@ -80,8 +97,9 @@ in {
# Let's install our client private key
$machine->succeed("mkdir -p ~/.ssh");
${concatMapStrings (s: "$machine->succeed('echo ${s} >> ~/.ssh/id_ecdsa');") snakeOilPrivateKey}
$machine->succeed("chmod 600 ~/.ssh/id_ecdsa");
$machine->succeed("echo '${snakeOilPrivateKey}' > ~/.ssh/id_ed25519");
$machine->succeed("chmod 600 ~/.ssh/id_ed25519");
# We haven't configured the host key yet, so this should still fail
$machine->fail("ssh -o BatchMode=yes localhost exit");
@ -90,7 +108,16 @@ in {
$machine->succeed("echo localhost,127.0.0.1 ${snakeOilPublicKey} > ~/.ssh/known_hosts");
$machine->succeed("ssh -o BatchMode=yes localhost exit");
# Test whether the root disk was resized.
my $blocks = $machine->succeed("stat -c %b -f /");
my $bsize = $machine->succeed("stat -c %S -f /");
my $size = $blocks * $bsize;
die "wrong free space $size" if $size < 9.7 * 1024 * 1024 * 1024 || $size > 10 * 1024 * 1024 * 1024;
# Just to make sure resizing is idempotent.
$machine->shutdown;
$machine->start;
$machine->waitForFile("/root/user-data");
'';
};

View File

@ -2,4 +2,4 @@ f: { system ? builtins.currentSystem, ... } @ args:
with import ../lib/testing.nix { inherit system; };
makeTest (if builtins.isFunction f then f (args // { inherit pkgs; }) else f)
makeTest (if builtins.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f)

View File

@ -141,6 +141,7 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
vmFlags = mkFlags ([
"--uart1 0x3F8 4"
"--uartmode1 client /run/virtualbox-log-${name}.sock"
"--memory 768"
] ++ (attrs.vmFlags or []));
controllerFlags = mkFlags [
@ -324,7 +325,7 @@ in {
mkVMConf = name: val: val.machine // { key = "${name}-config"; };
vmConfigs = mapAttrsToList mkVMConf vboxVMs;
in [ ./common/user-account.nix ./common/x11.nix ] ++ vmConfigs;
virtualisation.memorySize = 1024;
virtualisation.memorySize = 2048;
virtualisation.virtualbox.host.enable = true;
users.extraUsers.alice.extraGroups = let
inherit (config.virtualisation.virtualbox.host) enableHardening;
@ -412,6 +413,7 @@ in {
shutdownVM_detectvirt;
my $result = $machine->succeed("cat '$detectvirt_sharepath/result'");
chomp $result;
destroyVM_detectvirt;
die "systemd-detect-virt returned \"$result\" instead of \"oracle\""
if $result ne "oracle";
};
@ -422,11 +424,10 @@ in {
vbm("startvm test1");
waitForStartup_test1;
waitForVMBoot_test1;
vbm("startvm test2");
waitForStartup_test2;
waitForVMBoot_test1;
waitForVMBoot_test2;
$machine->screenshot("net_booted");

View File

@ -1,7 +1,8 @@
{ stdenv, fetchurl, lib, qtscriptgenerator, perl, gettext, curl
, libxml2, mysql, taglib, taglib_extras, loudmouth , kdelibs
, qca2, libmtp, liblastfm, libgpod, pkgconfig, automoc4, phonon
, strigi, soprano, qjson, ffmpeg, libofa, nepomuk_core ? null }:
{ stdenv, fetchurl, lib, automoc4, cmake, perl, pkgconfig
, qtscriptgenerator, gettext, curl , libxml2, mysql, taglib
, taglib_extras, loudmouth , kdelibs , qca2, libmtp, liblastfm, libgpod
, phonon , strigi, soprano, qjson, ffmpeg, libofa, nepomuk_core ? null
}:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
@ -16,9 +17,13 @@ stdenv.mkDerivation rec {
QT_PLUGIN_PATH="${qtscriptgenerator}/lib/qt4/plugins";
buildInputs = [ qtscriptgenerator stdenv.cc.libc gettext curl
libxml2 mysql.lib taglib taglib_extras loudmouth kdelibs automoc4 phonon strigi
soprano qca2 libmtp liblastfm libgpod pkgconfig qjson ffmpeg libofa nepomuk_core ];
nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
buildInputs = [
qtscriptgenerator stdenv.cc.libc gettext curl libxml2 mysql.lib
taglib taglib_extras loudmouth kdelibs phonon strigi soprano qca2
libmtp liblastfm libgpod qjson ffmpeg libofa nepomuk_core
];
cmakeFlags = "-DKDE4_BUILD_TESTS=OFF";

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, cmake
, withQt4 ? false, qt4
, withQt5 ? true, qt5
, withQt5 ? true, qtbase, qtsvg, qttools
# I'm unable to make KDE work here, crashes at runtime so I simply
# make Qt4 the default until someone who wants KDE can figure it out.
@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
buildInputs =
[ cmake ]
++ stdenv.lib.optional withQt4 qt4
++ stdenv.lib.optionals withQt5 (with qt5; [ base svg tools ])
++ stdenv.lib.optionals withQt5 [ qtbase qtsvg qttools ]
++ stdenv.lib.optional withKDE4 kde4.kdelibs
++ stdenv.lib.optionals withTaglib [ taglib taglib_extras ]
++ stdenv.lib.optionals withReplaygain [ ffmpeg speex mpg123 ]
@ -91,6 +91,10 @@ stdenv.mkDerivation rec {
"-DENABLE_UDISKS2=ON"
];
postInstall = ''
wrapQtProgram "$out/bin/cantata"
'';
meta = with stdenv.lib; {
homepage = http://code.google.com/p/cantata/;
description = "A graphical client for MPD";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fftw, libsndfile, qt5 }:
{ stdenv, fetchFromGitHub, fftw, libsndfile, qtbase, qtmultimedia }:
let
@ -39,7 +39,7 @@ in stdenv.mkDerivation {
owner = "gillesdegottex";
};
buildInputs = [ fftw libsndfile qt5.base qt5.multimedia ];
buildInputs = [ fftw libsndfile qtbase qtmultimedia ];
postPatch = ''
substituteInPlace dfasma.pro --replace '$$DFASMAVERSIONGITPRO' '${version}'
@ -53,6 +53,10 @@ in stdenv.mkDerivation {
enableParallelBuilding = true;
postInstall = ''
wrapQtProgram "$out/bin/dfasma"
'';
meta = with stdenv.lib; {
inherit version;
description = "Analyse and compare audio files in time and frequency";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fftw, freeglut, qt5
{ stdenv, fetchFromGitHub, fftw, freeglut, qtbase, qtmultimedia
, alsaSupport ? true, alsaLib ? null
, jackSupport ? false, libjack2 ? null
, portaudioSupport ? false, portaudio ? null }:
@ -18,7 +18,7 @@ stdenv.mkDerivation {
owner = "gillesdegottex";
};
buildInputs = [ fftw freeglut qt5.base qt5.multimedia ]
buildInputs = [ fftw freeglut qtbase qtmultimedia ]
++ stdenv.lib.optional alsaSupport [ alsaLib ]
++ stdenv.lib.optional jackSupport [ libjack2 ]
++ stdenv.lib.optional portaudioSupport [ portaudio ];

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, libav_0_8, libkeyfinder, qt5, taglib }:
{ stdenv, fetchFromGitHub, libav_0_8, libkeyfinder, qtbase, qtxmlpatterns, taglib }:
let version = "2.00"; in
stdenv.mkDerivation {
@ -30,7 +30,7 @@ stdenv.mkDerivation {
};
# TODO: upgrade libav when "Audio sample format conversion failed" is fixed
buildInputs = [ libav_0_8 libkeyfinder qt5.base qt5.xmlpatterns taglib ];
buildInputs = [ libav_0_8 libkeyfinder qtbase qtxmlpatterns taglib ];
postPatch = ''
substituteInPlace is_KeyFinder.pro \

View File

@ -1,6 +1,7 @@
{ stdenv, fetchurl, cmake, pkgconfig
, alsaLib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis
, portaudio, qt5 #, tesseract
, portaudio, qtbase, qtdeclarative, qtenginio, qtscript, qtsvg, qttools
, qtwebkit, qtxmlpatterns
}:
stdenv.mkDerivation rec {
@ -36,8 +37,8 @@ stdenv.mkDerivation rec {
buildInputs = [
alsaLib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis
portaudio qt5.base qt5.declarative qt5.enginio qt5.script qt5.svg qt5.tools
qt5.webkit qt5.xmlpatterns #tesseract
portaudio qtbase qtdeclarative qtenginio qtscript qtsvg qttools
qtwebkit qtxmlpatterns #tesseract
];
meta = with stdenv.lib; {

View File

@ -1,40 +1,34 @@
# Based on Richard Wallace's post here: http://comments.gmane.org/gmane.linux.distributions.nixos/14734
{ fetchFromGitHub, stdenv, pythonPackages, gtk3, gobjectIntrospection, libnotify
, gst_all_1, wrapGAppsHook }:
{ fetchurl, stdenv, pythonPackages, gtk3, libnotify, gst_all_1 }:
pythonPackages.buildPythonPackage rec {
name = "pithos-${version}";
version = "1.0.1";
version = "1.1.1";
src = fetchurl {
url = "https://github.com/pithos/pithos/archive/${version}.tar.gz";
sha256 = "67b83927d5111067aefbf034d23880f96b1a2d300464e8491efa80e97e67f50f";
namePrefix = "";
src = fetchFromGitHub {
owner = "pithos";
repo = "pithos";
rev = version;
sha256 = "0373z7g1wd3g1xl8m4ipx5n2ka67a2wcn387nyk8yvgdikm14jm3";
};
postPatch = ''
substituteInPlace setup.py --replace "/usr/share" "$out/share"
'';
buildInputs = with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad libnotify ];
buildInputs = [ wrapGAppsHook ];
pythonPath = with pythonPackages; [ pygobject3 dbus pylast ];
propogatedBuildInputs = pythonPath;
postInstall = ''
wrapProgram "$out/bin/pithos" --prefix GST_PLUGIN_SYSTEM_PATH_1_0 ":" "$GST_PLUGIN_SYSTEM_PATH_1_0"
'';
propagatedBuildInputs =
[ gtk3 gobjectIntrospection libnotify ] ++
(with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad ]) ++
(with pythonPackages; [ pygobject3 pylast ]);
meta = with stdenv.lib; {
description = "Pandora player";
longDescription = ''
Pandora Internet Radio player for GNOME
'';
homepage = http://pithos.github.io/ ;
description = "Pandora Internet Radio player for GNOME";
homepage = https://pithos.github.io/;
license = licenses.gpl3;
maintainers = with maintainers; [ obadz ];
maintainers = with maintainers; [ obadz jgeerds ];
};
}

View File

@ -2,7 +2,7 @@
{ stdenv, fetchurl, alsaLib, bzip2, fftw, libjack2, libX11, liblo
, libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate
, libsndfile, pkgconfig, libpulseaudio, qt5, redland
, libsndfile, pkgconfig, libpulseaudio, qtbase, redland
, rubberband, serd, sord, vampSDK, fftwFloat
}:
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
};
buildInputs =
[ libsndfile qt5.base fftw fftwFloat bzip2 librdf rubberband
[ libsndfile qtbase fftw fftwFloat bzip2 librdf rubberband
libsamplerate vampSDK alsaLib librdf_raptor librdf_rasqal redland
serd
sord
@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/{bin,share/sonic-visualiser}
cp sonic-visualiser $out/bin/
cp -r samples $out/share/sonic-visualiser/
wrapQtProgram "$out/bin/sonic-visualiser"
'';
meta = with stdenv.lib; {

View File

@ -1,6 +1,12 @@
{stdenv, fetchurl, libogg, libvorbis, libao, pkgconfig, curl, glibc
, speex, flac}:
{ stdenv, fetchurl, fetchzip, libogg, libvorbis, libao, pkgconfig, curl
, speex, flac }:
let
debPatch = fetchzip {
url = "mirror://debian/pool/main/v/vorbis-tools/vorbis-tools_1.4.0-6.debian.tar.xz";
sha256 = "1xmmpdvxyr84lazlg23c6ck5ic97ga2rkiqabb1d98ix2zdzyqz5";
};
in
stdenv.mkDerivation {
name = "vorbis-tools-1.4.0";
src = fetchurl {
@ -8,14 +14,23 @@ stdenv.mkDerivation {
sha256 = "1g12bnh5ah08v529y72kfdz5lhvy75iaz7f9jskyby23m9dkk2d3";
};
buildInputs = [ libogg libvorbis libao pkgconfig curl speex glibc flac ];
postPatch = ''
for patch in $(ls "${debPatch}"/patches/*.{diff,patch} | grep -v debian_subdir)
do patch -p1 < "$patch"
done
'';
meta = {
buildInputs = [ libogg libvorbis libao pkgconfig curl speex flac ];
meta = with stdenv.lib; {
description = "Extra tools for Ogg-Vorbis audio codec";
longDescription = ''
A set of command-line tools to manipulate Ogg Vorbis audio
files, notably the `ogg123' player and the `oggenc' encoder.
'';
homepage = http://xiph.org/vorbis/;
license = stdenv.lib.licenses.gpl2;
license = licenses.gpl2;
platforms = platforms.all;
};
}

View File

@ -1,6 +1,7 @@
{ stdenv, fetchurl, pam, pkgconfig, libxcb, glib, libXdmcp, itstool, libxml2
, intltool, xlibsWrapper, libxklavier, libgcrypt, libaudit
, qt4 ? null, qt5 ? null
, qt4 ? null
, withQt5 ? false, qtbase
}:
let
@ -20,14 +21,14 @@ stdenv.mkDerivation rec {
buildInputs = [
pkgconfig pam libxcb glib libXdmcp itstool libxml2 intltool libxklavier libgcrypt
qt4 libaudit
] ++ stdenv.lib.optional (qt5 != null) qt5.base;
] ++ stdenv.lib.optional withQt5 qtbase;
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--disable-tests"
] ++ stdenv.lib.optional (qt4 != null) "--enable-liblightdm-qt"
++ stdenv.lib.optional ((qt5.base or null) != null) "--enable-liblightdm-qt5";
++ stdenv.lib.optional withQt5 "--enable-liblightdm-qt5";
installFlags = [
"sysconfdir=\${out}/etc"

View File

@ -1,5 +1,7 @@
{ stdenv, fetchpatch, makeWrapper, fetchFromGitHub, cmake, pkgconfig, libxcb, libpthreadstubs
, libXdmcp, libXau, qt5, pam, systemd }:
{ stdenv, fetchpatch, fetchFromGitHub, cmake, pkgconfig, libxcb
, libpthreadstubs, libXdmcp, libXau, qtbase, qtdeclarative, qttools, pam
, systemd
}:
let
version = "0.11.0";
@ -14,9 +16,9 @@ stdenv.mkDerivation rec {
sha256 = "1s1gm0xvgwzrpxgni3ngdj8phzg21gkk1jyiv2l2i5ayl0jdm7ig";
};
nativeBuildInputs = [ cmake pkgconfig qt5.tools makeWrapper ];
nativeBuildInputs = [ cmake pkgconfig qttools ];
buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qt5.base pam systemd ];
buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qtbase qtdeclarative pam systemd ];
patches = [ (fetchpatch {
url = "https://github.com/sddm/sddm/commit/9bc21ee7da5de6b2531d47d1af4d7b0a169990b9.patch";
@ -32,8 +34,8 @@ stdenv.mkDerivation rec {
'';
postInstall = ''
wrapProgram $out/bin/sddm-greeter \
--set QML2_IMPORT_PATH "${qt5.declarative}/lib/qt5/qml/"
wrapQtProgram $out/bin/sddm
wrapQtProgram $out/bin/sddm-greeter
'';
enableParallelBuilding = true;

View File

@ -237,25 +237,25 @@ in
idea-community = buildIdea rec {
name = "idea-community-${version}";
version = "14.1.4";
build = "IC-141.1532.4";
version = "14.1.5";
build = "IC-141.2735.5";
description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
license = stdenv.lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
sha256 = "1yx93dfbajk2icm2jkfp5s5jnr1czyk179va3n5zndzzhzags4xx";
sha256 = "196rijl2k24ysjihdsisfy8hjl21wcn98fn8wagvxsvjf7anyg9k";
};
};
idea-ultimate = buildIdea rec {
name = "idea-ultimate-${version}";
version = "14.1.4";
build = "IU-141.1532.4";
version = "14.1.5";
build = "IU-141.2735.5";
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
license = stdenv.lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIU-${version}.tar.gz";
sha256 = "1hxs0mh35r43iqd1i1s2g1ha91q2wnb6xs95w572khzjm5dznvaw";
sha256 = "0wxb7m0k3kbjnr42rwzsk4g09qxqsmnpsdj769azamvsr4p904k9";
};
};

View File

@ -1,11 +1,12 @@
{ stdenv, fetchurl } :
stdenv.mkDerivation rec {
name = "joe-4.0";
version = "4.1";
name = "joe-${version}";
src = fetchurl {
url = "mirror://sourceforge/joe-editor/${name}.tar.gz";
sha256 = "0599xp90idl3dkplz72p33d2rfg0hb5yd38rhqdvz5zxfzzssmn5";
sha256 = "1nznzr9h0rh8g15c56yxzwpn2labx9sgsak0wcnpj7wmpnr12ql1";
};
meta = with stdenv.lib; {

View File

@ -1,4 +1,6 @@
{stdenv, fetchurl, kdelibs, cmake, gettext }:
{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
, shared_mime_info, kdelibs
}:
stdenv.mkDerivation rec {
name = "kile-2.1.3";
@ -8,7 +10,9 @@ stdenv.mkDerivation rec {
sha256 = "18nfi37s46v9xav7vyki3phasddgcy4m7nywzxis198vr97yqqx0";
};
nativeBuildInputs = [ cmake gettext ];
nativeBuildInputs = [
automoc4 cmake gettext perl pkgconfig shared_mime_info
];
buildInputs = [ kdelibs ];
# for KDE 4.7 the nl translations fail since kile-2.1.2

View File

@ -1,23 +1,24 @@
diff --git a/src/auto/configure b/src/auto/configure
index a9755a0..4a0e2a4 100755
--- a/auto/configure
+++ b/auto/configure
@@ -5638,10 +5638,6 @@ __:
@@ -5895,13 +5895,6 @@
eof
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
- if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
- "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
- vi_cv_path_python_plibs="-framework Python"
- if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
- vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
- fi
- else
if test "${vi_cv_var_python_version}" = "1.4"; then
vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
else
@@ -5649,7 +5645,6 @@ eof
fi
@@ -5921,7 +5914,6 @@
vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
- fi
fi
-fi
if ${vi_cv_dll_name_python+:} false; then :
$as_echo_n "(cached) " >&6

View File

@ -1,32 +0,0 @@
{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, qimageblitz, qca2, eigen,
lcms, jasper, libgphoto2, kdepimlibs, gettext, soprano, libjpeg, libtiff,
liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost,
shared_desktop_ontologies, marble, libmysql }:
stdenv.mkDerivation rec {
name = "digikam-2.9.0";
src = fetchurl {
url = "mirror://sourceforge/digikam/${name}.tar.bz2";
sha256 = "181vf065j1zz26zahkb7hy3fk4837nvwm61cnykvni7w40w0zpbk";
};
nativeBuildInputs = [ cmake automoc4 pkgconfig ];
buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
opencv libkexiv2 libkipi boost shared_desktop_ontologies marble libmysql ];
# Make digikam find some FindXXXX.cmake
KDEDIRS="${marble}:${qjson}";
enableParallelBuilding = true;
meta = {
description = "Photo Management Program";
license = "GPL";
homepage = http://www.digikam.org;
maintainers = with stdenv.lib.maintainers; [ viric urkud ];
inherit (kdelibs.meta) platforms;
};
}

View File

@ -1,8 +1,8 @@
{ stdenv, fetchurl, automoc4, boost, shared_desktop_ontologies, cmake
, eigen, lcms, gettext, jasper, kdelibs, kdepimlibs, lensfun
, libgphoto2, libjpeg, libkdcraw, libkexiv2, libkipi, libpgf, libtiff
, libusb1, liblqr1, marble, mysql, opencv, phonon, pkgconfig, qca2
, qimageblitz, qjson, qt4, soprano
, libusb1, liblqr1, marble, mysql, opencv, perl, phonon, pkgconfig
, qca2, qimageblitz, qjson, qt4, soprano
}:
stdenv.mkDerivation rec {
@ -13,12 +13,12 @@ stdenv.mkDerivation rec {
sha256 = "081ldsaf3frf5khznjd3sxkjmi4dyp6w6nqnc2a0agkk0kxkl10m";
};
nativeBuildInputs = [ cmake automoc4 pkgconfig ];
nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
buildInputs = [
boost eigen gettext jasper kdelibs kdepimlibs lcms lensfun
libgphoto2 libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf
libtiff marble mysql.lib opencv phonon qca2 qimageblitz qjson qt4
boost eigen jasper kdelibs kdepimlibs lcms lensfun libgphoto2
libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf libtiff marble
mysql.lib opencv phonon qca2 qimageblitz qjson qt4
shared_desktop_ontologies soprano
];
@ -26,7 +26,11 @@ stdenv.mkDerivation rec {
KDEDIRS="${marble}:${qjson}";
# Help digiKam find libusb, otherwise gphoto2 support is disabled
cmakeFlags = "-DLIBUSB_LIBRARIES=${libusb1}/lib -DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0 -DDIGIKAMSC_COMPILE_LIBKFACE=ON";
cmakeFlags = [
"-DLIBUSB_LIBRARIES=${libusb1}/lib"
"-DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0"
"-DDIGIKAMSC_COMPILE_LIBKFACE=ON"
];
enableParallelBuilding = true;

View File

@ -1,4 +1,6 @@
{ stdenv, fetchurl, kdelibs, automoc4, boost, pkgconfig, graphviz, gettext }:
{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
, kdelibs, boost, graphviz
}:
stdenv.mkDerivation rec {
name = "kgraphviewer-${version}";
@ -9,7 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "13zhjs57xavzrj4nrlqs35n35ihvzij7hgbszf5fhlp2a4d4rrqs";
};
buildInputs = [ kdelibs automoc4 boost pkgconfig graphviz gettext ];
buildInputs = [ kdelibs boost graphviz ];
nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
meta = with stdenv.lib; {
description = "A Graphviz dot graph viewer for KDE";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, kdelibs, imlib, cmake, pkgconfig, gettext }:
{ stdenv, fetchurl, automoc4, kdelibs, imlib, cmake, pkgconfig, gettext }:
stdenv.mkDerivation rec {
name = "kuickshow-0.9.1";
@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
buildInputs = [ kdelibs imlib ];
nativeBuildInputs = [ cmake gettext pkgconfig ];
nativeBuildInputs = [ automoc4 cmake gettext pkgconfig ];
}

View File

@ -0,0 +1,43 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, karchive
, kconfig
, kcrash
, kdbusaddons
, ki18n
, kiconthemes
, khtml
, kio
, kservice
, kpty
, kwidgetsaddons
, libarchive
}:
kdeApp {
name = "ark";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
karchive
kconfig
kcrash
kdbusaddons
ki18n
kiconthemes
khtml
kio
kservice
kpty
kwidgetsaddons
libarchive
];
meta = {
license = with lib.licenses; [ gpl2 lgpl3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,33 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, kconfig
, kio
, ki18n
, kservice
, kfilemetadata
, baloo
, kdelibs4support
}:
kdeApp {
name = "baloo-widgets";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
kconfig
kio
ki18n
kservice
kfilemetadata
baloo
kdelibs4support
];
meta = {
license = [ lib.licenses.lgpl21 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,68 @@
# Maintainer's Notes:
#
# Minor updates:
# 1. Edit ./manifest.sh to point to the updated URL. Upstream sometimes
# releases updates that include only the changed packages; in this case,
# multiple URLs can be provided and the results will be merged.
# 2. Run ./manifest.sh and ./dependencies.sh.
# 3. Build and enjoy.
#
# Major updates:
# We prefer not to immediately overwrite older versions with major updates, so
# make a copy of this directory first. After copying, be sure to delete ./tmp
# if it exists. Then follow the minor update instructions.
{ pkgs, debug ? false }:
let
inherit (pkgs) lib stdenv;
srcs = import ./srcs.nix { inherit (pkgs) fetchurl; inherit mirror; };
mirror = "mirror://kde";
kdeApp = args:
let
inherit (args) name;
sname = args.sname or name;
inherit (srcs."${sname}") src version;
in stdenv.mkDerivation (args // {
name = "${name}-${version}";
inherit src;
cmakeFlags =
(args.cmakeFlags or [])
++ [ "-DBUILD_TESTING=OFF" ]
++ lib.optional debug "-DCMAKE_BUILD_TYPE=Debug";
meta = {
platforms = lib.platforms.linux;
homepage = "http://www.kde.org";
} // (args.meta or {});
});
packages = self: with self; {
kdelibs = callPackage ./kdelibs { inherit (pkgs) attica phonon; };
ark = callPackage ./ark.nix {};
baloo-widgets = callPackage ./baloo-widgets.nix {};
dolphin = callPackage ./dolphin.nix {};
dolphin-plugins = callPackage ./dolphin-plugins.nix {};
ffmpegthumbs = callPackage ./ffmpegthumbs.nix {};
gpgmepp = callPackage ./gpgmepp.nix {};
gwenview = callPackage ./gwenview.nix {};
kate = callPackage ./kate.nix {};
kdegraphics-thumbnailers = callPackage ./kdegraphics-thumbnailers.nix {};
kgpg = callPackage ./kgpg.nix { inherit (pkgs.kde4) kdepimlibs; };
konsole = callPackage ./konsole.nix {};
ksnapshot = callPackage ./ksnapshot.nix {};
libkdcraw = callPackage ./libkdcraw.nix {};
libkexiv2 = callPackage ./libkexiv2.nix {};
libkipi = callPackage ./libkipi.nix {};
okular = callPackage ./okular.nix {};
print-manager = callPackage ./print-manager.nix {};
};
newScope = scope: pkgs.kf513.newScope ({ inherit kdeApp; } // scope);
in lib.makeScope newScope packages

View File

@ -0,0 +1,29 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, kxmlgui
, ki18n
, kio
, kdelibs4support
, dolphin
}:
kdeApp {
name = "dolphin-plugins";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
kxmlgui
ki18n
kio
kdelibs4support
dolphin
];
meta = {
license = [ lib.licenses.gpl2 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,63 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, kinit
, kcmutils
, kcoreaddons
, knewstuff
, ki18n
, kdbusaddons
, kbookmarks
, kconfig
, kio
, kparts
, solid
, kiconthemes
, kcompletion
, ktexteditor
, kwindowsystem
, knotifications
, kactivities
, phonon
, baloo
, baloo-widgets
, kfilemetadata
, kdelibs4support
}:
kdeApp {
name = "dolphin";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
kinit
kcmutils
kcoreaddons
knewstuff
ki18n
kdbusaddons
kbookmarks
kconfig
kio
kparts
solid
kiconthemes
kcompletion
ktexteditor
kwindowsystem
knotifications
kactivities
phonon
baloo
baloo-widgets
kfilemetadata
kdelibs4support
];
meta = {
license = with lib.licenses; [ gpl2 fdl12 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,47 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils findutils gnused nix wget
set -x
# The trailing slash at the end is necessary!
RELEASE_URL="http://download.kde.org/stable/applications/15.08.1/"
EXTRA_WGET_ARGS='-A *.tar.xz'
mkdir tmp; cd tmp
wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS
cat >../srcs.nix <<EOF
# DO NOT EDIT! This file is generated automatically by manifest.sh
{ fetchurl, mirror }:
{
EOF
workdir=$(pwd)
find . | while read src; do
if [[ -f "${src}" ]]; then
url="${src:2}"
# Sanitize file name
filename=$(basename "$src" | tr '@' '_')
nameversion="${filename%.tar.*}"
name=$(echo "$nameversion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,')
version=$(echo "$nameversion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,')
sha256=$(nix-hash --type sha256 --base32 --flat "$src")
cat >>../srcs.nix <<EOF
$name = {
version = "$version";
src = fetchurl {
url = "\${mirror}/$url";
sha256 = "$sha256";
name = "$filename";
};
};
EOF
fi
done
echo "}" >>../srcs.nix
cd ..

View File

@ -0,0 +1,27 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, kdelibs
, ffmpeg
}:
kdeApp {
name = "ffmpegthumbs";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
ffmpeg
];
meta = {
license = with lib.licenses; [ gpl2 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,21 @@
{ kdeApp
, lib
, extra-cmake-modules
, boost
, gpgme
}:
kdeApp {
name = "gpgmepp";
nativeBuildInputs = [
extra-cmake-modules
];
buildInputs = [
boost
gpgme
];
meta = {
license = with lib.licenses; [ lgpl21 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,37 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, baloo
, exiv2
, kactivities
, kdelibs4support
, kio
, lcms2
, phonon
, qtsvg
, qtx11extras
}:
kdeApp {
name = "gwenview";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
baloo
exiv2
kactivities
kdelibs4support
kio
lcms2
phonon
qtsvg
qtx11extras
];
meta = {
license = with lib.licenses; [ gpl2 fdl12 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,63 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, qtscript
, kactivities
, kconfig
, kcrash
, kguiaddons
, kiconthemes
, ki18n
, kinit
, kjobwidgets
, kio
, kparts
, ktexteditor
, kwindowsystem
, kxmlgui
, kdbusaddons
, kwallet
, plasma-framework
, kitemmodels
, knotifications
, threadweaver
, knewstuff
, libgit2
}:
kdeApp {
name = "kate";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
qtscript
kactivities
kconfig
kcrash
kguiaddons
kiconthemes
ki18n
kinit
kjobwidgets
kio
kparts
ktexteditor
kwindowsystem
kxmlgui
kdbusaddons
kwallet
plasma-framework
kitemmodels
knotifications
threadweaver
knewstuff
libgit2
];
meta = {
license = with lib.licenses; [ gpl3 lgpl3 lgpl2 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,29 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, kdelibs
, libkexiv2
, libkdcraw
}:
kdeApp {
name = "kdegraphics-thumbnailers";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
libkexiv2
libkdcraw
];
meta = {
license = [ lib.licenses.lgpl21 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,56 @@
From b43c49109694940f0a26240753e879eb629dd02d Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Mon, 7 Sep 2015 13:54:57 -0500
Subject: [PATCH 1/2] old kde4 cmake policies
---
cmake/modules/FindKDE4Internal.cmake | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake
index 7d54b9b..c435571 100644
--- a/cmake/modules/FindKDE4Internal.cmake
+++ b/cmake/modules/FindKDE4Internal.cmake
@@ -345,6 +345,39 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below
+cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
+# set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3)
+cmake_policy(VERSION 2.4.5)
+
+# CMake 2.6, set compatibility behaviour to cmake 2.4
+# this must be executed always, because the CMAKE_MINIMUM_REQUIRED() command above
+# resets the policy settings, so we get a lot of warnings
+
+# CMP0000: don't require cmake_minimum_version() directly in the top level CMakeLists.txt, FindKDE4Internal.cmake is good enough
+cmake_policy(SET CMP0000 OLD)
+# CMP0002: in KDE4 we have multiple targets with the same name for the unit tests
+cmake_policy(SET CMP0002 OLD)
+# CMP0003: add the link paths to the link command as with cmake 2.4
+cmake_policy(SET CMP0003 OLD)
+# CMP0005: keep escaping behaviour for definitions added via add_definitions()
+cmake_policy(SET CMP0005 OLD)
+# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file
+# where this is done, macros and functions are executed with the policies as they
+# were when the were defined. Keep the OLD behaviour so we can set the policies here
+# for all KDE software without the big warning
+cmake_policy(SET CMP0011 OLD)
+
+# since cmake 2.8.4: when include()ing from inside cmake's module dir, prefer the files
+# in this directory over those from CMAKE_MODULE_PATH
+cmake_policy(SET CMP0017 NEW)
+
+# since cmake 3.0: use of the LOCATION target property is disallowed while it is used in KDE4Macros.cmake
+if (POLICY CMP0026)
+ cmake_policy(SET CMP0026 OLD)
+endif (POLICY CMP0026)
+
+
# Only do something if it hasn't been found yet
if(NOT KDE4_FOUND)
--
2.5.0

View File

@ -0,0 +1,25 @@
From fab35bac146a817f3af80f45531355fd70cd226b Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@gmail.com>
Date: Mon, 7 Sep 2015 13:56:03 -0500
Subject: [PATCH 2/2] polkit install path
---
kdecore/auth/ConfigureChecks.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdecore/auth/ConfigureChecks.cmake b/kdecore/auth/ConfigureChecks.cmake
index 7cf9cb5..c8334ae 100644
--- a/kdecore/auth/ConfigureChecks.cmake
+++ b/kdecore/auth/ConfigureChecks.cmake
@@ -150,7 +150,7 @@ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
${CMAKE_INSTALL_PREFIX} _KDE4_AUTH_POLICY_FILES_INSTALL_DIR
${POLKITQT-1_POLICY_FILES_INSTALL_DIR})
- set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${_KDE4_AUTH_POLICY_FILES_INSTALL_DIR} CACHE STRING
+ set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions" CACHE STRING
"Where policy files generated by KAuth will be installed" FORCE)
elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
set (KAUTH_COMPILING_FAKE_BACKEND TRUE)
--
2.5.0

View File

@ -0,0 +1,43 @@
{ kdeApp, attica, attr, automoc4, avahi, bison, cmake
, docbook_xml_dtd_42, docbook_xsl, flex, giflib, herqq, ilmbase
, libdbusmenu_qt, libjpeg, libxml2, libxslt, perl, phonon, pkgconfig
, polkit_qt4, qca2, qt4, shared_desktop_ontologies, shared_mime_info
, soprano, strigi, udev, xz
, lib
}:
kdeApp {
name = "kdelibs";
buildInputs = [
attica attr avahi giflib herqq libdbusmenu_qt libjpeg libxml2
polkit_qt4 qca2 shared_desktop_ontologies udev xz
];
propagatedBuildInputs = [ qt4 soprano phonon strigi ];
nativeBuildInputs = [
automoc4 bison cmake flex libxslt perl pkgconfig shared_mime_info
];
patches = [
./0001-old-kde4-cmake-policies.patch
./0002-polkit-install-path.patch
];
# cmake does not detect path to `ilmbase`
NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
cmakeFlags = [
"-DDOCBOOKXML_CURRENTDTD_DIR=${docbook_xml_dtd_42}/xml/dtd/docbook"
"-DDOCBOOKXSL_DIR=${docbook_xsl}/xml/xsl/docbook"
"-DHUPNP_ENABLED=ON"
"-DWITH_SOLID_UDISKS2=ON"
"-DKDE_DEFAULT_HOME=.kde"
];
setupHook = ./setup-hook.sh;
meta = {
licenses = with lib.licenses; [ gpl2 fdl12 lgpl21 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,12 @@
diff -ru -x '*~' kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake
--- kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake 2011-05-20 22:24:54.000000000 +0200
+++ kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake 2011-07-12 14:03:00.000000000 +0200
@@ -139,7 +139,7 @@
${CMAKE_INSTALL_PREFIX} _KDE4_AUTH_POLICY_FILES_INSTALL_DIR
${POLKITQT-1_POLICY_FILES_INSTALL_DIR})
- set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${_KDE4_AUTH_POLICY_FILES_INSTALL_DIR} CACHE STRING
+ set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions" CACHE STRING
"Where policy files generated by KAuth will be installed" FORCE)
elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
set (KAUTH_COMPILING_FAKE_BACKEND TRUE)

View File

@ -0,0 +1,10 @@
addQt4Plugins() {
if [[ -d "$1/lib/qt4/plugins" ]]; then
propagatedUserEnvPkgs+=" $1"
fi
if [[ -d "$1/lib/kde4/plugins" ]]; then
propagatedUserEnvPkgs+=" $1"
fi
}
envHooks+=(addQt4Plugins)

View File

@ -0,0 +1,31 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, boost
, gpgme
, kdelibs
, kdepimlibs
}:
kdeApp {
name = "kgpg";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
boost
gpgme
kdelibs
kdepimlibs
];
meta = {
license = [ lib.licenses.gpl2 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,61 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, qtscript
, kbookmarks
, kcompletion
, kconfig
, kconfigwidgets
, kcoreaddons
, kguiaddons
, ki18n
, kiconthemes
, kinit
, kdelibs4support
, kio
, knotifications
, knotifyconfig
, kparts
, kpty
, kservice
, ktextwidgets
, kwidgetsaddons
, kwindowsystem
, kxmlgui
}:
kdeApp {
name = "konsole";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
];
buildInputs = [
qtscript
kbookmarks
kcompletion
kconfig
kconfigwidgets
kcoreaddons
kguiaddons
ki18n
kiconthemes
kinit
kdelibs4support
kio
knotifications
knotifyconfig
kparts
kpty
kservice
ktextwidgets
kwidgetsaddons
kwindowsystem
kxmlgui
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,29 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, kdelibs
, libkipi
, libXfixes
}:
kdeApp {
name = "ksnapshot";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
libkipi
libXfixes
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,27 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, libraw
, kdelibs
}:
kdeApp {
name = "libkdcraw";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
libraw
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,27 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, exiv2
, kdelibs
}:
kdeApp {
name = "libkexiv2";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
exiv2
kdelibs
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,25 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, kdelibs
}:
kdeApp {
name = "libkipi";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,41 @@
{ kdeApp
, lib
, automoc4
, cmake
, perl
, pkgconfig
, kdelibs
, qimageblitz
, poppler_qt4
, libspectre
, libkexiv2
, djvulibre
, libtiff
, freetype
, ebook_tools
}:
kdeApp {
name = "okular";
nativeBuildInputs = [
automoc4
cmake
perl
pkgconfig
];
buildInputs = [
kdelibs
qimageblitz
poppler_qt4
libspectre
libkexiv2
djvulibre
libtiff
freetype
ebook_tools
];
meta = {
license = with lib.licenses; [ gpl2 lgpl21 fdl12 bsd3 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

View File

@ -0,0 +1,45 @@
{ kdeApp
, lib
, extra-cmake-modules
, qtdeclarative
, cups
, kconfig
, kconfigwidgets
, kdbusaddons
, kiconthemes
, ki18n
, kcmutils
, kio
, knotifications
, plasma-framework
, kwidgetsaddons
, kwindowsystem
, kitemviews
}:
kdeApp {
name = "print-manager";
nativeBuildInputs = [
extra-cmake-modules
];
buildInputs = [
qtdeclarative
cups
kconfig
kconfigwidgets
kdbusaddons
kiconthemes
ki18n
kcmutils
kio
knotifications
plasma-framework
kwidgetsaddons
kwindowsystem
kitemviews
];
meta = {
license = [ lib.licenses.gpl2 ];
maintainers = [ lib.maintainers.ttuegel ];
};
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More