3
0
Fork 0
forked from mirrors/nixpkgs

Merge remote-tracking branch 'upstream/master' into hardened-stdenv

This commit is contained in:
Robin Gloster 2016-02-27 00:08:08 +00:00
commit 3477e662e6
504 changed files with 28750 additions and 13232 deletions

View file

@ -1,7 +1,7 @@
# How to contribute
Note: contributing implies licensing those contributions
under the terms of [COPYING](./COPYING), which is an MIT-like license.
under the terms of [COPYING](../COPYING), which is an MIT-like license.
## Opening issues

17
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,17 @@
## Basic info
To make sure that we are on the same page:
* Kernel: (run `uname -a`)
* System: (NixOS: `nixos-version`, Ubuntu/Fedora: `lsb_release -a`, ...)
* Nix version: (run `nix-env --version`)
* Nixpkgs version: (run `nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion`)
## Describe your issue here
### Expected result
### Actual result
### Steps to reproduce

15
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,15 @@
###### Things done:
- [ ] Tested via `nix.useChroot`.
- [ ] Built on platform(s): .
- [ ] Tested compilation of all pkgs that depend on this change.
- [ ] Tested execution of binary products.
- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).
###### Extra
Fixes # .
cc @ .
---
_Please note, that points are not mandatory._

View file

@ -56,8 +56,11 @@ stdenv.mkDerivation {
inputFile = ./../pkgs/development/idris-modules/README.md;
outputFile = "languages-frameworks/idris.xml";
}
+ toDocbook {
inputFile = ./../pkgs/development/r-modules/README.md;
outputFile = "languages-frameworks/r.xml";
}
+ ''
cat languages-frameworks/idris.xml
echo ${nixpkgsVersion} > .version
xmllint --noout --nonet --xinclude --noxincludenode \

View file

@ -21,6 +21,7 @@ such as Perl or Haskell. These are described in this chapter.</para>
<xi:include href="lua.xml" />
<xi:include href="coq.xml" />
<xi:include href="idris.xml" /> <!-- generated from ../../pkgs/development/idris-modules/README.md -->
<xi:include href="r.xml" /> <!-- generated from ../../pkgs/development/r-modules/README.md -->
<xi:include href="qt.xml" />

View file

@ -258,45 +258,54 @@ a value from <varname>stdenv.lib.licenses</varname> defined in
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix">
<filename>nixpkgs/lib/licenses.nix</filename></link>,
or in-place license description of the same format if the license is
unlikely to be useful in another expression.
unlikely to be useful in another expression.</para>
<para>Although it's typically better to indicate the specific license,
a few generic options are available:
A few generic options are available, although it's typically better
to indicate the specific license:
<variablelist>
<varlistentry>
<term><varname>free</varname></term>
<term><varname>stdenv.lib.licenses.free</varname>,
<varname>"free"</varname></term>
<listitem><para>Catch-all for free software licenses not listed
above.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>unfree-redistributable</varname></term>
<term><varname>stdenv.lib.licenses.unfreeRedistributable</varname>,
<varname>"unfree-redistributable"</varname></term>
<listitem><para>Unfree package that can be redistributed in binary
form. That is, its legal to redistribute the
form. That is, its legal to redistribute the
<emphasis>output</emphasis> of the derivation. This means that
the package can be included in the Nixpkgs
channel.</para>
<para>Sometimes proprietary software can only be redistributed
unmodified. Make sure the builder doesnt actually modify the
unmodified. Make sure the builder doesnt actually modify the
original binaries; otherwise were breaking the license. For
instance, the NVIDIA X11 drivers can be redistributed unmodified,
but our builder applies <command>patchelf</command> to make them
work. Thus, its license is <varname>unfree</varname> and it
work. Thus, its license is <varname>"unfree"</varname> and it
cannot be included in the Nixpkgs channel.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>unfree</varname></term>
<listitem><para>Unfree package that cannot be redistributed. You
<term><varname>stdenv.lib.licenses.unfree</varname>,
<varname>"unfree"</varname></term>
<listitem><para>Unfree package that cannot be redistributed. You
can build it yourself, but you cannot redistribute the output of
the derivation. Thus it cannot be included in the Nixpkgs
the derivation. Thus it cannot be included in the Nixpkgs
channel.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>unfree-redistributable-firmware</varname></term>
<term><varname>stdenv.lib.licenses.unfreeRedistributableFirmware</varname>,
<varname>"unfree-redistributable-firmware"</varname></term>
<listitem><para>This package supplies unfree, redistributable
firmware. This is a separate value from
<varname>unfree-redistributable</varname> because not everybody

View file

@ -155,6 +155,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
fullName = "Common Public License 1.0";
};
doc = spdx {
spdxId = "DOC";
fullName = "DOC License";
};
efl10 = spdx {
spdxId = "EFL-1.0";
fullName = "Eiffel Forum License v1.0";

View file

@ -1,19 +1,19 @@
/* -*- coding: utf-8; -*- */
/* List of NixOS maintainers. The format is:
handle = "Real Name <address@example.org>";
where <handle> is preferred to be your GitHub username (so it's easy
to ping a package @<handle>), and <Real Name> is your real name, not
a pseudonym. Please keep the list alphabetically sorted. */
{
/* Add your name and email address here.
Keep the list alphabetically sorted.
Prefer the same attrname as your github username, please,
so it's easy to ping a package @maintainer.
*/
aaronschif = "Aaron Schif <aaronschif@gmail.com>";
a1russell = "Adam Russell <adamlr6+pub@gmail.com>";
aaronschif = "Aaron Schif <aaronschif@gmail.com>";
abaldeau = "Andreas Baldeau <andreas@baldeau.net>";
abbradar = "Nikolay Amiantov <ab@fmap.me>";
adev = "Adrien Devresse <adev@adev.name>";
aforemny = "Alexander Foremny <alexanderforemny@googlemail.com>";
adev = "Adrien Devresse <adev@adev.name>";
aespinosa = "Allan Espinosa <allan.espinosa@outlook.com>";
aflatter = "Alexander Flatter <flatter@fastmail.fm>";
aforemny = "Alexander Foremny <alexanderforemny@googlemail.com>";
aherrmann = "Andreas Herrmann <andreash87@gmx.ch>";
ak = "Alexander Kjeldaas <ak@formalprivacy.com>";
akaWolf = "Artjom Vejsel <akawolf0@gmail.com>";
@ -45,8 +45,8 @@
bcarrell = "Brandon Carrell <brandoncarrell@gmail.com>";
bcdarwin = "Ben Darwin <bcdarwin@gmail.com>";
bdimcheff = "Brandon Dimcheff <brandon@dimcheff.com>";
bennofs = "Benno Fünfstück <benno.fuenfstueck@gmail.com>";
benley = "Benjamin Staffin <benley@gmail.com>";
bennofs = "Benno Fünfstück <benno.fuenfstueck@gmail.com>";
berdario = "Dario Bertini <berdario@gmail.com>";
bergey = "Daniel Bergey <bergey@teallabs.org>";
bjg = "Brian Gough <bjg@gnu.org>";
@ -58,6 +58,7 @@
bosu = "Boris Sukholitko <boriss@gmail.com>";
bramd = "Bram Duvigneau <bram@bramd.nl>";
bstrik = "Berno Strik <dutchman55@gmx.com>";
bzizou = "Bruno Bzeznik <Bruno@bzizou.net>";
c0dehero = "CodeHero <codehero@nerdpol.ch>";
calrama = "Moritz Maxeiner <moritz@ucworks.org>";
campadrenalin = "Philip Horger <campadrenalin@gmail.com>";
@ -80,9 +81,9 @@
davidak = "David Kleuker <post@davidak.de>";
davidrusu = "David Rusu <davidrusu.me@gmail.com>";
dbohdan = "Danyil Bohdan <danyil.bohdan@gmail.com>";
DerGuteMoritz = "Moritz Heidkamp <moritz@twoticketsplease.de>";
deepfire = "Kosyrev Serge <_deepfire@feelingofgreen.ru>";
demin-dmitriy = "Dmitriy Demin <demindf@gmail.com>";
DerGuteMoritz = "Moritz Heidkamp <moritz@twoticketsplease.de>";
desiderius = "Didier J. Devroye <didier@devroye.name>";
devhell = "devhell <\"^\"@regexmail.net>";
dezgeg = "Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>";
@ -122,6 +123,7 @@
ftrvxmtrx = "Siarhei Zirukin <ftrvxmtrx@gmail.com>";
funfunctor = "Edward O'Callaghan <eocallaghan@alterapraxis.com>";
fuuzetsu = "Mateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>";
fxfactorial = "Edgar Aroutiounian <edgar.factorial@gmail.com>";
gal_bolle = "Florent Becker <florent.becker@ens-lyon.org>";
garbas = "Rok Garbas <rok@garbas.si>";
garrison = "Jim Garrison <jim@garrison.cc>";
@ -132,6 +134,7 @@
gleber = "Gleb Peregud <gleber.p@gmail.com>";
globin = "Robin Gloster <mail@glob.in>";
goibhniu = "Cillian de Róiste <cillian.deroiste@gmail.com>";
Gonzih = "Max Gonzih <gonzih@gmail.com>";
gridaphobe = "Eric Seidel <eric@seidel.io>";
guibert = "David Guibert <david.guibert@gmail.com>";
havvy = "Ryan Scheel <ryan.havvy@gmail.com>";
@ -188,9 +191,9 @@
lowfatcomputing = "Andreas Wagner <andreas.wagner@lowfatcomputing.org>";
lsix = "Lancelot SIX <lsix@lancelotsix.com>";
ludo = "Ludovic Courtès <ludo@gnu.org>";
luispedro = "Luis Pedro Coelho <luis@luispedro.org>";
lukasepple = "Lukas Epple <post@lukasepple.de>";
lukego = "Luke Gorrie <luke@snabb.co>";
luispedro = "Luis Pedro Coelho <luis@luispedro.org>";
lw = "Sergey Sofeychuk <lw@fmap.me>";
madjar = "Georges Dubus <georges.dubus@compiletoi.net>";
magnetophon = "Bart Brouns <bart@magnetophon.nl>";
@ -200,25 +203,25 @@
manveru = "Michael Fellinger <m.fellinger@gmail.com>";
marcweber = "Marc Weber <marco-oweber@gmx.de>";
markWot = "Markus Wotringer <markus@wotringer.de>";
maurer = "Matthew Maurer <matthew.r.maurer+nix@gmail.com>";
matejc = "Matej Cotman <cotman.matej@gmail.com>";
mathnerd314 = "Mathnerd314 <mathnerd314.gph+hs@gmail.com>";
matthiasbeyer = "Matthias Beyer <mail@beyermatthias.de>";
maurer = "Matthew Maurer <matthew.r.maurer+nix@gmail.com>";
mbakke = "Marius Bakke <ymse@tuta.io>";
mbe = "Brandon Edens <brandonedens@gmail.com>";
mcmtroffaes = "Matthias C. M. Troffaes <matthias.troffaes@gmail.com>";
meditans = "Carlo Nucera <meditans@gmail.com>";
meisternu = "Matt Miemiec <meister@krutt.org>";
michelk = "Michel Kuhlmann <michel@kuhlmanns.info>";
michaelpj = "Michael Peyton Jones <michaelpj@gmail.com>";
michelk = "Michel Kuhlmann <michel@kuhlmanns.info>";
mingchuan = "Ming Chuan <ming@culpring.com>";
mirdhyn = "Merlin Gaillard <mirdhyn@gmail.com>";
mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>";
modulistic = "Pablo Costa <modulistic@gmail.com>";
mog = "Matthew O'Gorman <mog-lists@rldn.net>";
mornfall = "Petr Ročkai <me@mornfall.net>";
MP2E = "Cray Elliott <MP2E@archlinux.us>";
msackman = "Matthew Sackman <matthew@wellquite.org>";
mschristiansen = "Mikkel Christiansen <mikkel@rheosystems.com>";
msteen = "Matthijs Steen <emailmatthijs@gmail.com>";
mtreskin = "Max Treskin <zerthurd@gmail.com>";
mudri = "James Wood <lamudri@gmail.com>";
@ -245,8 +248,9 @@
palo = "Ingolf Wanger <palipalo9@googlemail.com>";
pashev = "Igor Pashev <pashev.igor@gmail.com>";
pesterhazy = "Paulus Esterhazy <pesterhazy@gmail.com>";
phile314 = "Philipp Hausmann <nix@314.ch>";
philandstuff = "Philip Potter <philip.g.potter@gmail.com>";
phile314 = "Philipp Hausmann <nix@314.ch>";
Phlogistique = "Noé Rubinstein <noe.rubinstein@gmail.com>";
phreedom = "Evgeny Egorochkin <phreedom@yandex.ru>";
phunehehe = "Hoang Xuan Phu <phunehehe@gmail.com>";
pierron = "Nicolas B. Pierron <nixos@nbp.name>";
@ -255,7 +259,6 @@
pjones = "Peter Jones <pjones@devalot.com>";
pkmx = "Chih-Mao Chen <pkmx.tw@gmail.com>";
plcplc = "Philip Lykke Carlsen <plcplc@gmail.com>";
Phlogistique = "Noé Rubinstein <noe.rubinstein@gmail.com>";
pmahoney = "Patrick Mahoney <pat@polycrystal.org>";
pmiddend = "Philipp Middendorf <pmidden@secure.mailbox.org>";
prikhi = "Pavan Rikhi <pavan.rikhi@gmail.com>";
@ -347,9 +350,9 @@
winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>";
wizeman = "Ricardo M. Correia <rcorreia@wizy.org>";
wjlroe = "William Roe <willroe@gmail.com>";
womfoo = "Kranium Gikos Mendoza <kranium@gikos.net>";
wkennington = "William A. Kennington III <william@wkennington.com>";
wmertens = "Wout Mertens <Wout.Mertens@gmail.com>";
womfoo = "Kranium Gikos Mendoza <kranium@gikos.net>";
wscott = "Wayne Scott <wsc9tt@gmail.com>";
wyvie = "Elijah Rum <elijahrum@gmail.com>";
yarr = "Dmitry V. <savraz@gmail.com>";
@ -359,5 +362,4 @@
zimbatm = "zimbatm <zimbatm@zimbatm.com>";
zohl = "Al Zohali <zohl@fmap.me>";
zoomulator = "Kim Simmons <zoomulator@gmail.com>";
Gonzih = "Max Gonzih <gonzih@gmail.com>";
}

View file

@ -1,21 +1,24 @@
let lists = import ./lists.nix; in
rec {
gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */
linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "mips64el-linux"];
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos;
allBut = platforms: lists.filter (x: !(builtins.elem x platforms)) all;
none = [];
arm = ["armv5tel-linux" "armv6l-linux" "armv7l-linux" ];
i686 = ["i686-linux" "i686-freebsd" "i686-netbsd" "i686-cygwin"];
mips = [ "mips64el-linux" ];
x86_64 = ["x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin"];
cygwin = ["i686-cygwin" "x86_64-cygwin"];
darwin = ["x86_64-darwin"];
freebsd = ["i686-freebsd" "x86_64-freebsd"];
openbsd = ["i686-openbsd" "x86_64-openbsd"];
netbsd = ["i686-netbsd" "x86_64-netbsd"];
cygwin = ["i686-cygwin" "x86_64-cygwin"];
gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */
illumos = ["x86_64-solaris"];
linux = ["i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "mips64el-linux"];
netbsd = ["i686-netbsd" "x86_64-netbsd"];
openbsd = ["i686-openbsd" "x86_64-openbsd"];
unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos;
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos;
none = [];
allBut = platforms: lists.filter (x: !(builtins.elem x platforms)) all;
mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux"];
x86_64 = ["x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin"];
i686 = ["i686-linux" "i686-freebsd" "i686-netbsd" "i686-cygwin"];
arm = ["armv5tel-linux" "armv6l-linux" "armv7l-linux" ];
mips = [ "mips64el-linux" ];
}

View file

@ -84,10 +84,10 @@ rec {
};
isDarwin = matchAttrs { kernel = kernels.darwin; };
isLinux = matchAttrs { kernel = kernels.linux; };
isi686 = matchAttrs { cpu = cpuTypes.i686; };
is64Bit = matchAttrs { cpu = { bits = 64; }; };
isDarwin = matchAttrs { kernel = kernels.darwin; };
isi686 = matchAttrs { cpu = cpuTypes.i686; };
isLinux = matchAttrs { kernel = kernels.linux; };
# This should revert the job done by config.guess from the gcc compiler.

View file

@ -11,14 +11,14 @@ stdenv.mkDerivation {
buildCommand = ''
datadir="${nix}/share"
export TEST_ROOT=$(pwd)/test-tmp
export NIX_STORE_DIR=$TEST_ROOT/store
export NIX_BUILD_HOOK=
export NIX_CONF_DIR=$TEST_ROOT/etc
export NIX_DB_DIR=$TEST_ROOT/db
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
export NIX_STATE_DIR=$TEST_ROOT/var/nix
export NIX_DB_DIR=$TEST_ROOT/db
export NIX_CONF_DIR=$TEST_ROOT/etc
export NIX_MANIFESTS_DIR=$TEST_ROOT/var/nix/manifests
export NIX_BUILD_HOOK=
export NIX_STATE_DIR=$TEST_ROOT/var/nix
export NIX_STORE_DIR=$TEST_ROOT/store
export PAGER=cat
cacheDir=$TEST_ROOT/binary-cache
nix-store --init

View file

@ -18,7 +18,8 @@ let
fetchurlDependencies =
filter
(drv: drv.outputHash or "" != "" && drv.outputHashMode == "flat" && drv.postFetch or "" == "" && drv ? urls)
(drv: drv.outputHash or "" != "" && drv.outputHashMode or "flat" == "flat"
&& drv.postFetch or "" == "" && drv ? urls)
dependencies;
dependencies = map (x: x.value) (genericClosure {

View file

@ -1,22 +1,24 @@
{ stdenv, makeWrapper, perl, perlPackages }:
stdenv.mkDerivation {
name = "nix-generate-from-cpan-1";
name = "nix-generate-from-cpan-2";
buildInputs = [ makeWrapper perl perlPackages.YAMLLibYAML perlPackages.JSON perlPackages.CPANPLUS ];
buildInputs = with perlPackages; [
makeWrapper perl CPANMeta GetoptLongDescriptive CPANPLUS Readonly Log4Perl
];
unpackPhase = "true";
buildPhase = "true";
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/bin
cp ${./nix-generate-from-cpan.pl} $out/bin/nix-generate-from-cpan
patchShebangs $out/bin/nix-generate-from-cpan
wrapProgram $out/bin/nix-generate-from-cpan --set PERL5LIB $PERL5LIB
'';
meta = {
maintainers = [ stdenv.lib.maintainers.eelco ];
maintainers = with stdenv.lib.maintainers; [ eelco rycee ];
description = "Utility to generate a Nix expression for a Perl package from CPAN";
};
}

View file

@ -1,154 +1,440 @@
#! /run/current-system/sw/bin/perl -w
#!/usr/bin/env perl
use utf8;
use strict;
use CPANPLUS::Backend;
use YAML::XS;
use JSON;
use warnings;
my $module_name = $ARGV[0];
die "syntax: $0 <MODULE-NAME>\n" unless defined $module_name;
use CPAN::Meta();
use CPANPLUS::Backend();
use Getopt::Long::Descriptive qw( describe_options );
use JSON::PP qw( encode_json );
use Log::Log4perl qw(:easy);
use Readonly();
my $cb = CPANPLUS::Backend->new;
# Readonly hash that maps CPAN style license strings to information
# necessary to generate a Nixpkgs style license attribute.
Readonly::Hash my %LICENSE_MAP => (
my @modules = $cb->search(type => "name", allow => [$module_name]);
die "module $module_name not found\n" if scalar @modules == 0;
die "multiple packages that match module $module_name\n" if scalar @modules > 1;
my $module = $modules[0];
# The Perl 5 License (Artistic 1 & GPL 1 or later).
perl_5 => {
licenses => [qw( artistic1 gpl1Plus )]
},
# GNU Affero General Public License, Version 3.
agpl_3 => {
licenses => [qw( agpl3Plus )],
amb => 1
},
# Apache Software License, Version 1.1.
apache_1_1 => {
licenses => ["Apache License 1.1"],
in_set => 0
},
# Apache License, Version 2.0.
apache_2_0 => {
licenses => [qw( asl20 )]
},
# Artistic License, (Version 1).
artistic_1 => {
licenses => [qw( artistic1 )]
},
# Artistic License, Version 2.0.
artistic_2 => {
licenses => [qw( artistic2 )]
},
# BSD License (three-clause).
bsd => {
licenses => [qw( bsd3 )],
amb => 1
},
# FreeBSD License (two-clause).
freebsd => {
licenses => [qw( bsd2 )]
},
# GNU Free Documentation License, Version 1.2.
gfdl_1_2 => {
licenses => [qw( fdl12 )]
},
# GNU Free Documentation License, Version 1.3.
gfdl_1_3 => {
licenses => [qw( fdl13 )]
},
# GNU General Public License, Version 1.
gpl_1 => {
licenses => [qw( gpl1Plus )],
amb => 1
},
# GNU General Public License, Version 2. Note, we will interpret
# "gpl" alone as GPL v2+.
gpl_2 => {
licenses => [qw( gpl2Plus )],
amb => 1
},
# GNU General Public License, Version 3.
gpl_3 => {
licenses => [qw( gpl3Plus )],
amb => 1
},
# GNU Lesser General Public License, Version 2.1. Note, we will
# interpret "gpl" alone as LGPL v2.1+.
lgpl_2_1 => {
licenses => [qw( lgpl21Plus )],
amb => 1
},
# GNU Lesser General Public License, Version 3.0.
lgpl_3_0 => {
licenses => [qw( lgpl3Plus )],
amb => 1
},
# MIT (aka X11) License.
mit => {
licenses => [qw( mit )]
},
# Mozilla Public License, Version 1.0.
mozilla_1_0 => {
licenses => [qw( mpl10 )]
},
# Mozilla Public License, Version 1.1.
mozilla_1_1 => {
licenses => [qw( mpl11 )]
},
# OpenSSL License.
openssl => {
licenses => [qw( openssl )]
},
# Q Public License, Version 1.0.
qpl_1_0 => {
licenses => [qw( qpl )]
},
# Original SSLeay License.
ssleay => {
licenses => ["Original SSLeay License"],
in_set => 0
},
# Sun Internet Standards Source License (SISSL).
sun => {
licenses => ["Sun Industry Standards Source License v1.1"],
in_set => 0
},
# zlib License.
zlib => {
licenses => [qw( zlib )]
},
# Other Open Source Initiative (OSI) approved license.
open_source => {
licenses => [qw( free )],
amb => 1
},
# Requires special permission from copyright holder.
restricted => {
licenses => [qw( unfree )],
amb => 1
},
# Not an OSI approved license, but not restricted. Note, we
# currently map this to unfreeRedistributable, which is a
# conservative choice.
unrestricted => {
licenses => [qw( unfreeRedistributable )],
amb => 1
},
# License not provided in metadata.
unknown => {
licenses => [qw( unknown )],
amb => 1
}
);
sub handle_opts {
my ( $opt, $usage ) = describe_options(
'usage: $0 %o MODULE',
[ 'maintainer|m=s', 'the package maintainer' ],
[ 'debug|d', 'enable debug output' ],
[ 'help', 'print usage message and exit' ]
);
if ( $opt->help ) {
print $usage->text;
exit;
}
my $module_name = $ARGV[0];
if ( !defined $module_name ) {
print STDERR "Missing module name\n";
print STDERR $usage->text;
exit 1;
}
return ( $opt, $module_name );
}
# Takes a Perl package attribute name and returns 1 if the name cannot
# be referred to as a bareword. This typically happens if the package
# name is a reserved Nix keyword.
sub is_reserved {
my ($pkg) = @_;
return $pkg =~ /^(?: assert |
else |
if |
import |
in |
inherit |
let |
rec |
then |
while |
with )$/x;
}
sub pkg_to_attr {
my ($pkg_name) = @_;
my $attr_name = $pkg_name;
$attr_name =~ s/-\d.*//; # strip version
return "LWP" if $attr_name eq "libwww-perl";
$attr_name =~ s/-//g;
return $attr_name;
my ($module) = @_;
my $attr_name = $module->package_name;
if ( $attr_name eq "libwww-perl" ) {
return "LWP";
}
else {
$attr_name =~ s/-//g;
return $attr_name;
}
}
sub get_pkg_name {
my ($module) = @_;
my $pkg_name = $module->package;
$pkg_name =~ s/\.tar.*//;
$pkg_name =~ s/\.zip//;
return $pkg_name;
return $module->package_name . '-' . $module->package_version;
}
my $pkg_name = get_pkg_name $module;
my $attr_name = pkg_to_attr $pkg_name;
sub read_meta {
my ($pkg_path) = @_;
print STDERR "attribute name: ", $attr_name, "\n";
print STDERR "module: ", $module->module, "\n";
print STDERR "version: ", $module->version, "\n";
print STDERR "package: ", $module->package, , " (", $pkg_name, ", ", $attr_name, ")\n";
print STDERR "path: ", $module->path, "\n";
my $yaml_path = "$pkg_path/META.yml";
my $json_path = "$pkg_path/META.json";
my $meta;
my $tar_path = $module->fetch();
print STDERR "downloaded to: $tar_path\n";
print STDERR "sha-256: ", $module->status->checksum_value, "\n";
my $pkg_path = $module->extract();
print STDERR "unpacked to: $pkg_path\n";
my $meta;
if (-e "$pkg_path/META.yml") {
eval {
$meta = YAML::XS::LoadFile("$pkg_path/META.yml");
};
if ($@) {
system("iconv -f windows-1252 -t utf-8 '$pkg_path/META.yml' > '$pkg_path/META.yml.tmp'");
$meta = YAML::XS::LoadFile("$pkg_path/META.yml.tmp");
if ( -r $json_path ) {
$meta = CPAN::Meta->load_file($json_path);
}
elsif ( -r $yaml_path ) {
$meta = CPAN::Meta->load_file($yaml_path);
}
else {
WARN("package has no META.yml or META.json");
}
} elsif (-e "$pkg_path/META.json") {
local $/;
open(my $fh, '<', "$pkg_path/META.json") or die;
$meta = decode_json(<$fh>);
} else {
warn "package has no META.yml or META.json\n";
}
print STDERR "metadata: ", encode_json($meta), "\n" if defined $meta;
return $meta;
}
# Map a module to the attribute corresponding to its package
# (e.g. HTML::HeadParser will be mapped to HTMLParser, because that
# module is in the HTML-Parser package).
sub module_to_pkg {
my ($module_name) = @_;
my @modules = $cb->search(type => "name", allow => [$module_name]);
if (scalar @modules == 0) {
my ( $cb, $module_name ) = @_;
my @modules = $cb->search( type => "name", allow => [$module_name] );
if ( scalar @modules == 0 ) {
# Fallback.
$module_name =~ s/:://g;
return $module_name;
}
my $module = $modules[0];
my $attr_name = pkg_to_attr(get_pkg_name $module);
print STDERR "mapped dep $module_name to $attr_name\n";
my $module = $modules[0];
my $attr_name = pkg_to_attr($module);
DEBUG("mapped dep $module_name to $attr_name");
return $attr_name;
}
sub get_deps {
my ($type) = @_;
my $deps;
if (defined $meta->{prereqs}) {
die "unimplemented";
} elsif ($type eq "runtime") {
$deps = $meta->{requires};
} elsif ($type eq "configure") {
$deps = $meta->{configure_requires};
} elsif ($type eq "build") {
$deps = $meta->{build_requires};
}
my ( $cb, $meta, $type ) = @_;
return if !defined $meta;
my $prereqs = $meta->effective_prereqs;
my $deps = $prereqs->requirements_for( $type, "requires" );
my @res;
foreach my $n (keys %{$deps}) {
foreach my $n ( $deps->required_modules ) {
next if $n eq "perl";
# Hacky way to figure out if this module is part of Perl.
if ($n !~ /^JSON/ && $n !~ /^YAML/ && $n !~ /^Module::Pluggable/) {
if ( $n !~ /^JSON/ && $n !~ /^YAML/ && $n !~ /^Module::Pluggable/ ) {
eval "use $n;";
if (!$@) {
print STDERR "skipping Perl-builtin module $n\n";
if ( !$@ ) {
DEBUG("skipping Perl-builtin module $n");
next;
}
}
push @res, module_to_pkg($n);
my $pkg = module_to_pkg( $cb, $n );
# If the package name is reserved then we need to refer to it
# through the "self" variable.
$pkg = "self.\"$pkg\"" if is_reserved($pkg);
push @res, $pkg;
}
return @res;
}
sub uniq {
return keys %{{ map { $_ => 1 } @_ }};
return keys %{ { map { $_ => 1 } @_ } };
}
my @build_deps = sort(uniq(get_deps("configure"), get_deps("build"), get_deps("test")));
print STDERR "build deps: @build_deps\n";
sub render_license {
my ($cpan_license) = @_;
my @runtime_deps = sort(uniq(get_deps("runtime")));
print STDERR "runtime deps: @runtime_deps\n";
return if !defined $cpan_license;
my $homepage = $meta->{resources}->{homepage};
print STDERR "homepage: $homepage\n" if defined $homepage;
my $licenses;
my $description = $meta->{abstract};
if (defined $description) {
$description = uc(substr($description, 0, 1)) . substr($description, 1); # capitalise first letter
$description =~ s/\.$//; # remove period at the end
# If the license is ambiguous then we'll print an extra warning.
# For example, "gpl_2" is ambiguous since it may refer to exactly
# "GPL v2" or to "GPL v2 or later".
my $amb = 0;
# Whether the license is available inside `stdenv.lib.licenses`.
my $in_set = 1;
my $nix_license = $LICENSE_MAP{$cpan_license};
if ( !$nix_license ) {
WARN("Unknown license: $cpan_license");
$licenses = [$cpan_license];
$in_set = 0;
}
else {
$licenses = $nix_license->{licenses};
$amb = $nix_license->{amb};
$in_set = !$nix_license->{in_set};
}
my $license_line;
if ( @$licenses == 0 ) {
# Avoid defining the license line.
}
elsif ($in_set) {
my $lic = 'stdenv.lib.licenses';
if ( @$licenses == 1 ) {
$license_line = "$lic.$licenses->[0]";
}
else {
$license_line = "with $lic; [ " . join( ' ', @$licenses ) . " ]";
}
}
else {
if ( @$licenses == 1 ) {
$license_line = $licenses->[0];
}
else {
$license_line = '[ ' . join( ' ', @$licenses ) . ' ]';
}
}
INFO("license: $cpan_license");
WARN("License '$cpan_license' is ambiguous, please verify") if $amb;
return $license_line;
}
my ( $opt, $module_name ) = handle_opts();
Log::Log4perl->easy_init(
{
level => $opt->debug ? $DEBUG : $INFO,
layout => '%m%n'
}
);
my $cb = CPANPLUS::Backend->new;
my @modules = $cb->search( type => "name", allow => [$module_name] );
die "module $module_name not found\n" if scalar @modules == 0;
die "multiple packages that match module $module_name\n" if scalar @modules > 1;
my $module = $modules[0];
my $pkg_name = get_pkg_name $module;
my $attr_name = pkg_to_attr $module;
INFO( "attribute name: ", $attr_name );
INFO( "module: ", $module->module );
INFO( "version: ", $module->version );
INFO( "package: ", $module->package, " (", $pkg_name, ", ", $attr_name, ")" );
INFO( "path: ", $module->path );
my $tar_path = $module->fetch();
INFO( "downloaded to: ", $tar_path );
INFO( "sha-256: ", $module->status->checksum_value );
my $pkg_path = $module->extract();
INFO( "unpacked to: ", $pkg_path );
my $meta = read_meta($pkg_path);
DEBUG( "metadata: ", encode_json( $meta->as_struct ) ) if defined $meta;
my @build_deps = sort( uniq(
get_deps( $cb, $meta, "configure" ),
get_deps( $cb, $meta, "build" ),
get_deps( $cb, $meta, "test" )
) );
INFO("build deps: @build_deps");
my @runtime_deps = sort( uniq( get_deps( $cb, $meta, "runtime" ) ) );
INFO("runtime deps: @runtime_deps");
my $homepage = $meta ? $meta->resources->{homepage} : undef;
INFO("homepage: $homepage") if defined $homepage;
my $description = $meta ? $meta->abstract : undef;
if ( defined $description ) {
$description = uc( substr( $description, 0, 1 ) )
. substr( $description, 1 ); # capitalise first letter
$description =~ s/\.$//; # remove period at the end
$description =~ s/\s*$//;
$description =~ s/^\s*//;
print STDERR "description: $description\n";
$description =~ s/\n+/ /; # Replace new lines by space.
INFO("description: $description");
}
my $license = $meta->{license};
if (defined $license) {
$license = "perl5" if $license eq "perl_5";
print STDERR "license: $license\n";
}
#print(Data::Dumper::Dumper($meta->licenses) . "\n");
my $license = $meta ? render_license( $meta->licenses ) : undef;
my $build_fun = -e "$pkg_path/Build.PL" && ! -e "$pkg_path/Makefile.PL" ? "buildPerlModule" : "buildPerlPackage";
INFO( "RSS feed: https://metacpan.org/feed/distribution/",
$module->package_name );
my $build_fun = -e "$pkg_path/Build.PL"
&& !-e "$pkg_path/Makefile.PL" ? "buildPerlModule" : "buildPerlPackage";
print STDERR "===\n";
print <<EOF;
$attr_name = $build_fun {
"$attr_name" = $build_fun rec {
name = "$pkg_name";
src = fetchurl {
url = mirror://cpan/${\$module->path}/${\$module->package};
url = "mirror://cpan/${\$module->path}/\${name}.${\$module->package_extension}";
sha256 = "${\$module->status->checksum_value}";
};
EOF
@ -168,7 +454,10 @@ print <<EOF if defined $description;
description = "$description";
EOF
print <<EOF if defined $license;
license = "$license";
license = $license;
EOF
print <<EOF if $opt->maintainer;
maintainers = [ maintainers.${\$opt->maintainer} ];
EOF
print <<EOF;
};

View file

@ -27,6 +27,9 @@ elif [[ $1 == nox ]]; then
elif [[ $1 == build ]]; then
source $HOME/.nix-profile/etc/profile.d/nix.sh
echo "=== Checking tarball creation"
nix-build pkgs/top-level/release.nix -A tarball
if [[ $TRAVIS_PULL_REQUEST == false ]]; then
echo "=== Not a pull request"
else
@ -41,8 +44,6 @@ elif [[ $1 == build ]]; then
exit 1
fi
fi
# echo "=== Checking tarball creation"
# nix-build pkgs/top-level/release.nix -A tarball
else
echo "$0: Unknown option $1" >&2
false

View file

@ -28,7 +28,7 @@ fetchGithubName () {
)"
userid="$(
curl https://github.com/NixOS/nixpkgs/commit/"$commitid" 2>/dev/null |
grep authored -B10 | grep 'href="/' |
grep committed -B10 | grep 'href="/' |
sed -re 's@.* href="/@@; s@".*@@' |
grep -v "/commit/"
)";

View file

@ -26,6 +26,7 @@ effect after you run <command>nixos-rebuild</command>.</para>
<!-- FIXME: auto-include NixOS module docs -->
<xi:include href="postgresql.xml" />
<xi:include href="gitlab.xml" />
<xi:include href="acme.xml" />
<xi:include href="nixos.xml" />

View file

@ -56,6 +56,7 @@ let
cp -prd $sources/* . # */
chmod -R u+w .
cp ${../../modules/services/databases/postgresql.xml} configuration/postgresql.xml
cp ${../../modules/services/misc/gitlab.xml} configuration/gitlab.xml
cp ${../../modules/security/acme.xml} configuration/acme.xml
cp ${../../modules/misc/nixos.xml} configuration/nixos.xml
ln -s ${optionsDocBook} options-db.xml

View file

@ -44,6 +44,7 @@ nixos.path = ./nixpkgs-unstable-2015-12-06/nixos;
<listitem><para><literal>services/networking/pdnsd.nix</literal></para></listitem>
<listitem><para><literal>services/web-apps/pump.io.nix</literal></para></listitem>
<listitem><para><literal>services/security/haka.nix</literal></para></listitem>
<listitem><para><literal>i18n/inputMethod/default.nix</literal></para></listitem>
</itemizedlist>
</para>
@ -197,6 +198,47 @@ fileSystems."/example" = {
<literal>services.hardware.opengl.extraPackages{,32}</literal> instead. You can
also specify VDPAU drivers there.</para>
</listitem>
<listitem>
<para>
<literal>programs.ibus</literal> moved to <literal>i18n.inputMethod.ibus</literal>.
The option <literal>programs.ibus.plugins</literal> changed to <literal>i18n.inputMethod.ibus.engines</literal>
and the option to enable ibus changed from <literal>programs.ibus.enable</literal> to
<literal>i18n.inputMethod.enabled</literal>.
<literal>i18n.inputMethod.enabled</literal> should be set to the used input method name,
<literal>"ibus"</literal> for ibus.
An example of the new style:
<programlisting>
i18n.inputMethod.enabled = "ibus";
i18n.inputMethod.ibus.engines = with pkgs.ibus-engines; [ anthy mozc ];
</programlisting>
That is equivalent to the old version:
<programlisting>
programs.ibus.enable = true;
programs.ibus.plugins = with pkgs; [ ibus-anthy mozc ];
</programlisting>
</para>
</listitem>
<listitem>
<para><literal>services.udev.extraRules</literal> option now writes rules
to <filename>99-local.rules</filename> instead of <filename>10-local.rules</filename>.
This makes all the user rules apply after others, so their results wouldn't be
overriden by anything else.</para>
</listitem>
<listitem>
<para>Large parts of the <literal>services.gitlab</literal> module has been
been rewritten. There are new configuration options available. The
<literal>stateDir</literal> option was renamned to
<literal>statePath</literal> and the <literal>satellitesDir</literal> option
was removed. Please review the currently available options.</para>
</listitem>
</itemizedlist>
@ -215,6 +257,12 @@ fileSystems."/example" = {
NixOS.</para>
</listitem>
<listitem>
<para>Input method support was improved. New NixOS modules (fcitx, nabi and uim),
fcitx engines (chewing, hangul, m17n, mozc and table-other) and ibus engines (hangul and m17n)
have been added.</para>
</listitem>
</itemizedlist></para>
</section>

View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
with lib;
{
options = {
i18n.inputMethod = {
enabled = mkOption {
type = types.nullOr (types.enum [ "ibus" "fcitx" "nabi" "uim" ]);
default = null;
example = "fcitx";
description = ''
Select the enabled input method. Input methods is a software to input symbols that are not available on standard input devices.
Input methods are specially used to input Chinese, Japanese and Korean characters.
Currently the following input methods are available in NixOS:
<itemizedlist>
<listitem><para>ibus: The intelligent input bus, extra input engines can be added using <literal>i18n.inputMethod.ibus.engines</literal>.</para></listitem>
<listitem><para>fcitx: A customizable lightweight input method, extra input engines can be added using <literal>i18n.inputMethod.fcitx.engines</literal>.</para></listitem>
<listitem><para>nabi: A Korean input method based on XIM. Nabi doesn't support Qt 5.</para></listitem>
<listitem><para>uim: The universal input method, is a library with a XIM bridge. uim mainly support Chinese, Japanese and Korean.</para></listitem>
</itemizedlist>
'';
};
};
};
}

View file

@ -0,0 +1,42 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.fcitx;
fcitxPackage = pkgs.fcitx-with-plugins.override { plugins = cfg.engines; };
fcitxEngine = types.package // {
name = "fcitx-engine";
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isFcitxEngine"] false x);
};
in
{
options = {
i18n.inputMethod.fcitx = {
engines = mkOption {
type = with types; listOf fcitxEngine;
default = [];
example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]";
description = ''
Enabled Fcitx engines.
Available engines can be found by running `nix-env "&lt;nixpkgs&gt;" . -qaP -A fcitx-engines`.
'';
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "fcitx") {
environment.systemPackages = [ fcitxPackage ];
gtkPlugins = [ fcitxPackage ];
qtPlugins = [ fcitxPackage ];
environment.variables = {
GTK_IM_MODULE = "fcitx";
QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
};
services.xserver.displayManager.sessionCommands = "${fcitxPackage}/bin/fcitx";
};
}

View file

@ -0,0 +1,43 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.ibus;
ibusPackage = pkgs.ibus-with-plugins.override { plugins = cfg.engines; };
ibusEngine = types.package // {
name = "ibus-engine";
check = x: (lib.types.package.check x) && (attrByPath ["meta" "isIbusEngine"] false x);
};
in
{
options = {
i18n.inputMethod.ibus = {
engines = mkOption {
type = with types; listOf ibusEngine;
default = [];
example = literalExample "with pkgs.ibus-engines; [ mozc hangul ]";
description = ''
Enabled IBus engines.
Available engines can be found by running `nix-env "&lt;nixpkgs&gt;" . -qaP -A ibus-engines`.
'';
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "ibus") {
# Without dconf enabled it is impossible to use IBus
environment.systemPackages = [ ibusPackage pkgs.gnome3.dconf ];
gtkPlugins = [ pkgs.ibus ];
qtPlugins = [ pkgs.ibus-qt ];
environment.variables = {
GTK_IM_MODULE = "ibus";
QT_IM_MODULE = "ibus";
XMODIFIERS = "@im=ibus";
};
services.xserver.displayManager.sessionCommands = "${ibusPackage}/bin/ibus-daemon --daemonize --xim --cache=none";
};
}

View file

@ -0,0 +1,17 @@
{ config, pkgs, lib, ... }:
with lib;
{
config = mkIf (config.i18n.inputMethod.enabled == "nabi") {
environment.systemPackages = [ pkgs.nabi ];
qtPlugins = [ pkgs.nabi ];
environment.variables = {
GTK_IM_MODULE = "nabi";
QT_IM_MODULE = "nabi";
XMODIFIERS = "@im=nabi";
};
services.xserver.displayManager.sessionCommands = "${pkgs.nabi}/bin/nabi &";
};
}

View file

@ -0,0 +1,39 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.i18n.inputMethod.uim;
in
{
options = {
i18n.inputMethod.uim = {
toolbar = mkOption {
type = types.enum [ "gtk" "gtk3" "gtk-systray" "gtk3-systray" "qt4" ];
default = "gtk";
example = "gtk-systray";
description = ''
selected UIM toolbar.
'';
};
};
};
config = mkIf (config.i18n.inputMethod.enabled == "uim") {
environment.systemPackages = [ pkgs.uim ];
gtkPlugins = [ pkgs.uim ];
qtPlugins = [ pkgs.uim ];
environment.variables = {
GTK_IM_MODULE = "uim";
QT_IM_MODULE = "uim";
XMODIFIERS = "@im=uim";
};
services.xserver.displayManager.sessionCommands = ''
${pkgs.uim}/bin/uim-xim &
${pkgs.uim}/bin/uim-toolbar-${cfg.toolbar} &
'';
};
}

View file

@ -252,6 +252,7 @@
gammu-smsd = 228;
pdnsd = 229;
octoprint = 230;
avahi-autoipd = 231;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!

View file

@ -43,6 +43,11 @@
./hardware/video/nvidia.nix
./hardware/video/ati.nix
./hardware/video/webcam/facetimehd.nix
./i18n/inputMethod/default.nix
./i18n/inputMethod/fcitx.nix
./i18n/inputMethod/ibus.nix
./i18n/inputMethod/nabi.nix
./i18n/inputMethod/uim.nix
./installer/tools/auto-upgrade.nix
./installer/tools/nixos-checkout.nix
./installer/tools/tools.nix
@ -66,7 +71,6 @@
./programs/environment.nix
./programs/freetds.nix
./programs/fish.nix
./programs/ibus.nix
./programs/kbdlight.nix
./programs/light.nix
./programs/man.nix
@ -89,6 +93,7 @@
./security/ca.nix
./security/duosec.nix
./security/grsecurity.nix
./security/oath.nix
./security/pam.nix
./security/pam_usb.nix
./security/pam_mount.nix
@ -253,6 +258,7 @@
./services/monitoring/dd-agent.nix
./services/monitoring/grafana.nix
./services/monitoring/graphite.nix
./services/monitoring/hdaps.nix
./services/monitoring/heapster.nix
./services/monitoring/longview.nix
./services/monitoring/monit.nix
@ -271,6 +277,7 @@
./services/monitoring/zabbix-agent.nix
./services/monitoring/zabbix-server.nix
./services/network-filesystems/drbd.nix
./services/network-filesystems/netatalk.nix
./services/network-filesystems/nfsd.nix
./services/network-filesystems/openafs-client/default.nix
./services/network-filesystems/rsyncd.nix
@ -442,6 +449,7 @@
./services/x11/display-managers/lightdm.nix
./services/x11/display-managers/sddm.nix
./services/x11/display-managers/slim.nix
./services/x11/hardware/libinput.nix
./services/x11/hardware/multitouch.nix
./services/x11/hardware/synaptics.nix
./services/x11/hardware/wacom.nix

View file

@ -14,4 +14,6 @@
# to the *boot time* of the host).
hwclock -s
'';
security.rngd.enable = false;
}

View file

@ -1,51 +0,0 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.programs.ibus;
in
{
options = {
programs.ibus = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = "Enable IBus input method";
};
plugins = mkOption {
type = lib.types.listOf lib.types.path;
default = [];
description = ''
IBus plugin packages
'';
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.ibus pkgs.gnome3.dconf ];
gtkPlugins = [ pkgs.ibus ];
qtPlugins = [ pkgs.ibus-qt ];
environment.variables =
let
env = pkgs.buildEnv {
name = "ibus-env";
paths = [ pkgs.ibus ] ++ cfg.plugins;
};
in {
GTK_IM_MODULE = "ibus";
QT_IM_MODULE = "ibus";
XMODIFIERS = "@im=ibus";
IBUS_COMPONENT_PATH = "${env}/share/ibus/component";
};
services.xserver.displayManager.sessionCommands = "${pkgs.ibus}/bin/ibus-daemon --daemonize --xim --cache=none";
};
}

View file

@ -28,6 +28,9 @@ with lib;
(mkRenamedOptionModule [ "services" "subsonic" "host" ] [ "services" "subsonic" "listenAddress" ])
(mkRenamedOptionModule [ "jobs" ] [ "systemd" "services" ])
(mkRenamedOptionModule [ "services" "gitlab" "stateDir" ] [ "services" "gitlab" "statePath" ])
(mkRemovedOptionModule [ "services" "gitlab" "satelliteDir" ])
# Old Grub-related options.
(mkRenamedOptionModule [ "boot" "initrd" "extraKernelModules" ] [ "boot" "initrd" "kernelModules" ])
(mkRenamedOptionModule [ "boot" "extraKernelParams" ] [ "boot" "kernelParams" ])
@ -59,6 +62,9 @@ with lib;
# Tarsnap
(mkRenamedOptionModule [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ])
# ibus
(mkRenamedOptionModule [ "programs" "ibus" "plugins" ] [ "i18n" "inputMethod" "ibus" "engines" ])
# proxy
(mkRenamedOptionModule [ "nix" "proxy" ] [ "networking" "proxy" "default" ])

View file

@ -56,7 +56,7 @@ let
plugins = mkOption {
type = types.listOf (types.enum [
"cert.der" "cert.pem" "chain.pem" "external_pem.sh"
"cert.der" "cert.pem" "chain.pem" "external.sh"
"fullchain.pem" "full.pem" "key.der" "key.pem" "account_key.json"
]);
default = [ "fullchain.pem" "key.pem" "account_key.json" ];

View file

@ -0,0 +1,50 @@
# This module provides configuration for the OATH PAM modules.
{ config, lib, pkgs, ... }:
with lib;
{
options = {
security.pam.oath = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable the OATH (one-time password) PAM module.
'';
};
digits = mkOption {
type = types.enum [ 6 7 8 ];
default = 6;
description = ''
Specify the length of the one-time password in number of
digits.
'';
};
window = mkOption {
type = types.int;
default = 5;
description = ''
Specify the number of one-time passwords to check in order
to accommodate for situations where the system and the
client are slightly out of sync (iteration for HOTP or time
steps for TOTP).
'';
};
usersFile = mkOption {
type = types.path;
default = "/etc/users.oath";
description = ''
Set the path to file where the user's credentials are
stored. This file must not be world readable!
'';
};
};
};
}

View file

@ -75,7 +75,7 @@ let
};
oathAuth = mkOption {
default = config.security.pam.enableOATH;
default = config.security.pam.oath.enable;
type = types.bool;
description = ''
If set, the OATH Toolkit will be used.
@ -259,8 +259,8 @@ let
"auth sufficient pam_unix.so ${optionalString cfg.allowNullPassword "nullok"} likeauth try_first_pass"}
${optionalString cfg.otpwAuth
"auth sufficient ${pkgs.otpw}/lib/security/pam_otpw.so"}
${optionalString cfg.oathAuth
"auth sufficient ${pkgs.oathToolkit}/lib/security/pam_oath.so window=5 usersfile=/etc/users.oath"}
${let oath = config.security.pam.oath; in optionalString cfg.oathAuth
"auth sufficient ${pkgs.oathToolkit}/lib/security/pam_oath.so window=${toString oath.window} usersfile=${toString oath.usersFile} digits=${toString oath.digits}"}
${optionalString config.users.ldap.enable
"auth sufficient ${pam_ldap}/lib/security/pam_ldap.so use_first_pass"}
${optionalString config.krb5.enable ''
@ -302,8 +302,6 @@ let
"session optional ${pam_krb5}/lib/security/pam_krb5.so"}
${optionalString cfg.otpwAuth
"session optional ${pkgs.otpw}/lib/security/pam_otpw.so"}
${optionalString cfg.oathAuth
"session optional ${pkgs.oathToolkit}/lib/security/pam_oath.so window=5 usersfile=/etc/users.oath"}
${optionalString cfg.startSession
"session optional ${pkgs.systemd}/lib/security/pam_systemd.so"}
${optionalString cfg.forwardXAuth
@ -405,13 +403,6 @@ in
'';
};
security.pam.enableOATH = mkOption {
default = false;
description = ''
Enable the OATH (one-time password) PAM module.
'';
};
security.pam.enableU2F = mkOption {
default = false;
description = ''
@ -446,7 +437,7 @@ in
++ optional config.users.ldap.enable pam_ldap
++ optionals config.krb5.enable [pam_krb5 pam_ccreds]
++ optionals config.security.pam.enableOTPW [ pkgs.otpw ]
++ optionals config.security.pam.enableOATH [ pkgs.oathToolkit ]
++ optionals config.security.pam.oath.enable [ pkgs.oathToolkit ]
++ optionals config.security.pam.enableU2F [ pkgs.pam_u2f ]
++ optionals config.security.pam.enableEcryptfs [ pkgs.ecryptfs ];

View file

@ -21,7 +21,13 @@ in
hardware.sane.enable = mkOption {
type = types.bool;
default = false;
description = "Enable support for SANE scanners.";
description = ''
Enable support for SANE scanners.
<note><para>
Users in the "scanner" group will gain access to the scanner.
</para></note>
'';
};
hardware.sane.snapshot = mkOption {
@ -33,7 +39,14 @@ in
hardware.sane.extraBackends = mkOption {
type = types.listOf types.path;
default = [];
description = "Packages providing extra SANE backends to enable.";
description = ''
Packages providing extra SANE backends to enable.
<note><para>
The example contains the package for HP scanners.
</para></note>
'';
example = literalExample "[ pkgs.hplipWithPlugin ]";
};
hardware.sane.configDir = mkOption {

View file

@ -13,13 +13,13 @@ let
extraUdevRules = pkgs.writeTextFile {
name = "extra-udev-rules";
text = cfg.extraRules;
destination = "/etc/udev/rules.d/10-local.rules";
destination = "/etc/udev/rules.d/99-local.rules";
};
extraHwdbFile = pkgs.writeTextFile {
name = "extra-hwdb-file";
text = cfg.extraHwdb;
destination = "/etc/udev/hwdb.d/10-local.hwdb";
destination = "/etc/udev/hwdb.d/99-local.hwdb";
};
nixosRules = ''
@ -212,8 +212,8 @@ in
type = types.lines;
description = ''
Additional <command>udev</command> rules. They'll be written
into file <filename>10-local.rules</filename>. Thus they are
read before all other rules.
into file <filename>99-local.rules</filename>. Thus they are
read and applied after all other rules.
'';
};

View file

@ -187,7 +187,6 @@ working_directory ENV["GITLAB_PATH"]
pid ENV["UNICORN_PATH"] + "/tmp/pids/unicorn.pid"
listen ENV["UNICORN_PATH"] + "/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true
timeout 60

View file

@ -7,10 +7,13 @@ with lib;
let
cfg = config.services.gitlab;
ruby = pkgs.gitlab.ruby;
ruby = cfg.packages.gitlab.ruby;
bundler = pkgs.bundler;
gemHome = "${pkgs.gitlab.env}/${ruby.gemPath}";
gemHome = "${cfg.packages.gitlab.env}/${ruby.gemPath}";
gitlabSocket = "${cfg.statePath}/tmp/sockets/gitlab.socket";
pathUrlQuote = url: replaceStrings ["/"] ["%2F"] url;
databaseYml = ''
production:
@ -21,14 +24,15 @@ let
username: ${cfg.databaseUsername}
encoding: utf8
'';
gitlabShellYml = ''
user: gitlab
gitlab_url: "http://${cfg.host}:${toString cfg.port}/"
user: ${cfg.user}
gitlab_url: "http+unix://${pathUrlQuote gitlabSocket}"
http_settings:
self_signed_cert: false
repos_path: "${cfg.stateDir}/repositories"
secret_file: "${cfg.stateDir}/config/gitlab_shell_secret"
log_file: "${cfg.stateDir}/log/gitlab-shell.log"
repos_path: "${cfg.statePath}/repositories"
secret_file: "${cfg.statePath}/config/gitlab_shell_secret"
log_file: "${cfg.statePath}/log/gitlab-shell.log"
redis:
bin: ${pkgs.redis}/bin/redis-cli
host: 127.0.0.1
@ -37,33 +41,102 @@ let
namespace: resque:gitlab
'';
gitlabConfig = {
# These are the default settings from config/gitlab.example.yml
production = flip recursiveUpdate cfg.extraConfig {
gitlab = {
host = cfg.host;
port = cfg.port;
https = cfg.https;
user = cfg.user;
email_enabled = true;
email_display_name = "GitLab";
email_reply_to = "noreply@localhost";
default_theme = 2;
default_projects_features = {
issues = true;
merge_requests = true;
wiki = true;
snippets = false;
builds = true;
};
};
artifacts = {
enabled = true;
};
lfs = {
enabled = true;
};
gravatar = {
enabled = true;
};
cron_jobs = {
stuck_ci_builds_worker = {
cron = "0 0 * * *";
};
};
gitlab_ci = {
builds_path = "${cfg.statePath}/builds";
};
ldap = {
enabled = false;
};
omniauth = {
enabled = false;
};
shared = {
path = "${cfg.statePath}/shared";
};
backup = {
path = "${cfg.backupPath}";
};
gitlab_shell = {
path = "${cfg.packages.gitlab-shell}";
repos_path = "${cfg.statePath}/repositories";
hooks_path = "${cfg.statePath}/shell/hooks";
secret_file = "${cfg.statePath}/config/gitlab_shell_secret";
upload_pack = true;
receive_pack = true;
};
git = {
bin_path = "git";
max_size = 20971520; # 20MB
timeout = 10;
};
extra = {};
};
};
gitlabEnv = {
HOME = "${cfg.statePath}/home";
GEM_HOME = gemHome;
BUNDLE_GEMFILE = "${cfg.packages.gitlab}/share/gitlab/Gemfile";
UNICORN_PATH = "${cfg.statePath}/";
GITLAB_PATH = "${cfg.packages.gitlab}/share/gitlab/";
GITLAB_STATE_PATH = "${cfg.statePath}";
GITLAB_UPLOADS_PATH = "${cfg.statePath}/uploads";
GITLAB_LOG_PATH = "${cfg.statePath}/log";
GITLAB_SHELL_PATH = "${cfg.packages.gitlab-shell}";
GITLAB_SHELL_CONFIG_PATH = "${cfg.statePath}/shell/config.yml";
GITLAB_SHELL_SECRET_PATH = "${cfg.statePath}/config/gitlab_shell_secret";
GITLAB_SHELL_HOOKS_PATH = "${cfg.statePath}/shell/hooks";
RAILS_ENV = "production";
};
unicornConfig = builtins.readFile ./defaultUnicornConfig.rb;
gitlab-runner = pkgs.stdenv.mkDerivation rec {
name = "gitlab-runner";
buildInputs = [ pkgs.gitlab pkgs.bundler pkgs.makeWrapper ];
buildInputs = [ cfg.packages.gitlab bundler pkgs.makeWrapper ];
phases = "installPhase fixupPhase";
buildPhase = "";
installPhase = ''
mkdir -p $out/bin
makeWrapper ${bundler}/bin/bundle $out/bin/gitlab-runner\
--set RAKEOPT '"-f ${pkgs.gitlab}/share/gitlab/Rakefile"'\
--set GEM_HOME '${gemHome}'\
--set UNICORN_PATH "${cfg.stateDir}/"\
--set GITLAB_PATH "${pkgs.gitlab}/share/gitlab/"\
--set GITLAB_APPLICATION_LOG_PATH "${cfg.stateDir}/log/application.log"\
--set GITLAB_SATELLITES_PATH "${cfg.stateDir}/satellites"\
--set GITLAB_SHELL_PATH "${pkgs.gitlab-shell}"\
--set GITLAB_REPOSITORIES_PATH "${cfg.stateDir}/repositories"\
--set GITLAB_SHELL_HOOKS_PATH "${cfg.stateDir}/shell/hooks"\
--set BUNDLE_GEMFILE "${pkgs.gitlab}/share/gitlab/Gemfile"\
--set GITLAB_EMAIL_FROM "${cfg.emailFrom}"\
--set GITLAB_SHELL_CONFIG_PATH "${cfg.stateDir}/shell/config.yml"\
--set GITLAB_SHELL_SECRET_PATH "${cfg.stateDir}/config/gitlab_shell_secret"\
--set GITLAB_HOST "${cfg.host}"\
--set GITLAB_PORT "${toString cfg.port}"\
--set GITLAB_BACKUP_PATH "${cfg.backupPath}"\
--set RAILS_ENV "production"
makeWrapper ${bundler}/bin/bundle $out/bin/gitlab-runner \
${concatStrings (mapAttrsToList (name: value: "--set ${name} '\"${value}\"' ") gitlabEnv)} \
--set GITLAB_CONFIG_PATH '"${cfg.statePath}/config"' \
--set PATH '"${pkgs.nodejs}/bin:${pkgs.gzip}/bin:${config.services.postgresql.package}/bin:$PATH"' \
--set RAKEOPT '"-f ${cfg.packages.gitlab}/share/gitlab/Rakefile"'
'';
};
@ -79,13 +152,25 @@ in {
'';
};
satelliteDir = mkOption {
type = types.str;
default = "/var/gitlab/git-satellites";
description = "Gitlab directory to store checked out git trees requires for operation.";
packages.gitlab = mkOption {
type = types.package;
default = pkgs.gitlab;
description = "Reference to the gitlab package";
};
stateDir = mkOption {
packages.gitlab-shell = mkOption {
type = types.package;
default = pkgs.gitlab-shell;
description = "Reference to the gitlab-shell package";
};
packages.gitlab-workhorse = mkOption {
type = types.package;
default = pkgs.gitlab-workhorse;
description = "Reference to the gitlab-workhorse package";
};
statePath = mkOption {
type = types.str;
default = "/var/gitlab/state";
description = "Gitlab state directory, logs are stored here.";
@ -93,7 +178,7 @@ in {
backupPath = mkOption {
type = types.str;
default = cfg.stateDir + "/backup";
default = cfg.statePath + "/backup";
description = "Gitlab path for backups.";
};
@ -136,14 +221,67 @@ in {
port = mkOption {
type = types.int;
default = 8080;
description = "Gitlab server listening port.";
description = ''
Gitlab server port for copy-paste URLs, e.g. 80 or 443 if you're
service over https.
'';
};
https = mkOption {
type = types.bool;
default = false;
description = "Whether gitlab prints URLs with https as scheme.";
};
user = mkOption {
type = types.str;
default = "gitlab";
description = "User to run gitlab and all related services.";
};
group = mkOption {
type = types.str;
default = "gitlab";
description = "Group to run gitlab and all related services.";
};
initialRootEmail = mkOption {
type = types.str;
default = "admin@local.host";
description = ''
Initial email address of the root account if this is a new install.
'';
};
initialRootPassword = mkOption {
type = types.str;
default = "UseNixOS!";
description = ''
Initial password of the root account if this is a new install.
'';
};
extraConfig = mkOption {
type = types.attrs;
default = {};
example = {
gitlab = {
default_projects_features = {
builds = false;
};
};
};
description = ''
Extra options to be merged into config/gitlab.yml as nix
attribute set.
'';
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.git gitlab-runner pkgs.gitlab-shell ];
environment.systemPackages = [ pkgs.git gitlab-runner cfg.packages.gitlab-shell ];
assertions = [
{ assertion = cfg.databasePassword != "";
@ -159,39 +297,24 @@ in {
services.postfix.enable = mkDefault true;
users.extraUsers = [
{ name = "gitlab";
group = "gitlab";
home = "${cfg.stateDir}/home";
{ name = cfg.user;
group = cfg.group;
home = "${cfg.statePath}/home";
shell = "${pkgs.bash}/bin/bash";
uid = config.ids.uids.gitlab;
} ];
}
];
users.extraGroups = [
{ name = "gitlab";
{ name = cfg.group;
gid = config.ids.gids.gitlab;
} ];
}
];
systemd.services.gitlab-sidekiq = {
after = [ "network.target" "redis.service" ];
wantedBy = [ "multi-user.target" ];
environment.HOME = "${cfg.stateDir}/home";
environment.GEM_HOME = gemHome;
environment.UNICORN_PATH = "${cfg.stateDir}/";
environment.GITLAB_PATH = "${pkgs.gitlab}/share/gitlab/";
environment.GITLAB_APPLICATION_LOG_PATH = "${cfg.stateDir}/log/application.log";
environment.GITLAB_SATELLITES_PATH = "${cfg.stateDir}/satellites";
environment.GITLAB_SHELL_PATH = "${pkgs.gitlab-shell}";
environment.GITLAB_REPOSITORIES_PATH = "${cfg.stateDir}/repositories";
environment.GITLAB_SHELL_HOOKS_PATH = "${cfg.stateDir}/shell/hooks";
environment.BUNDLE_GEMFILE = "${pkgs.gitlab}/share/gitlab/Gemfile";
environment.GITLAB_EMAIL_FROM = "${cfg.emailFrom}";
environment.GITLAB_SHELL_CONFIG_PATH = "${cfg.stateDir}/shell/config.yml";
environment.GITLAB_SHELL_SECRET_PATH = "${cfg.stateDir}/config/gitlab_shell_secret";
environment.GITLAB_HOST = "${cfg.host}";
environment.GITLAB_PORT = "${toString cfg.port}";
environment.GITLAB_DATABASE_HOST = "${cfg.databaseHost}";
environment.GITLAB_DATABASE_PASSWORD = "${cfg.databasePassword}";
environment.RAILS_ENV = "production";
environment = gitlabEnv;
path = with pkgs; [
config.services.postgresql.package
gitAndTools.git
@ -201,116 +324,131 @@ in {
];
serviceConfig = {
Type = "simple";
User = "gitlab";
Group = "gitlab";
User = cfg.user;
Group = cfg.group;
TimeoutSec = "300";
WorkingDirectory = "${pkgs.gitlab}/share/gitlab";
ExecStart="${bundler}/bin/bundle exec \"sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e production -P ${cfg.stateDir}/tmp/sidekiq.pid\"";
WorkingDirectory = "${cfg.packages.gitlab}/share/gitlab";
ExecStart="${bundler}/bin/bundle exec \"sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e production -P ${cfg.statePath}/tmp/sidekiq.pid\"";
};
};
systemd.services.gitlab-git-http-server = {
systemd.services.gitlab-workhorse = {
after = [ "network.target" "gitlab.service" ];
wantedBy = [ "multi-user.target" ];
environment.HOME = "${cfg.stateDir}/home";
environment.HOME = gitlabEnv.HOME;
environment.GITLAB_SHELL_CONFIG_PATH = gitlabEnv.GITLAB_SHELL_CONFIG_PATH;
path = with pkgs; [
gitAndTools.git
openssh
];
preStart = ''
mkdir -p /run/gitlab
chown ${cfg.user}:${cfg.group} /run/gitlab
'';
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
Type = "simple";
User = "gitlab";
Group = "gitlab";
User = cfg.user;
Group = cfg.group;
TimeoutSec = "300";
ExecStart = "${pkgs.gitlab-git-http-server}/bin/gitlab-git-http-server -listenUmask 0 -listenNetwork unix -listenAddr ${cfg.stateDir}/tmp/sockets/gitlab-git-http-server.socket -authBackend http://localhost:8080 ${cfg.stateDir}/repositories";
ExecStart =
"${cfg.packages.gitlab-workhorse}/bin/gitlab-workhorse "
+ "-listenUmask 0 "
+ "-listenNetwork unix "
+ "-listenAddr /run/gitlab/gitlab-workhorse.socket "
+ "-authSocket ${gitlabSocket} "
+ "-documentRoot ${cfg.packages.gitlab}/share/gitlab/public";
};
};
systemd.services.gitlab = {
after = [ "network.target" "postgresql.service" "redis.service" ];
wantedBy = [ "multi-user.target" ];
environment.HOME = "${cfg.stateDir}/home";
environment.GEM_HOME = gemHome;
environment.UNICORN_PATH = "${cfg.stateDir}/";
environment.GITLAB_PATH = "${pkgs.gitlab}/share/gitlab/";
environment.GITLAB_APPLICATION_LOG_PATH = "${cfg.stateDir}/log/application.log";
environment.GITLAB_SATELLITES_PATH = "${cfg.stateDir}/satellites";
environment.GITLAB_SHELL_PATH = "${pkgs.gitlab-shell}";
environment.GITLAB_SHELL_CONFIG_PATH = "${cfg.stateDir}/shell/config.yml";
environment.GITLAB_SHELL_SECRET_PATH = "${cfg.stateDir}/config/gitlab_shell_secret";
environment.GITLAB_REPOSITORIES_PATH = "${cfg.stateDir}/repositories";
environment.GITLAB_SHELL_HOOKS_PATH = "${cfg.stateDir}/shell/hooks";
environment.BUNDLE_GEMFILE = "${pkgs.gitlab}/share/gitlab/Gemfile";
environment.GITLAB_EMAIL_FROM = "${cfg.emailFrom}";
environment.GITLAB_HOST = "${cfg.host}";
environment.GITLAB_PORT = "${toString cfg.port}";
environment.GITLAB_DATABASE_HOST = "${cfg.databaseHost}";
environment.GITLAB_DATABASE_PASSWORD = "${cfg.databasePassword}";
environment.RAILS_ENV = "production";
environment = gitlabEnv;
path = with pkgs; [
config.services.postgresql.package
gitAndTools.git
ruby
openssh
nodejs
];
preStart = ''
# TODO: use env vars
mkdir -p ${cfg.stateDir}
mkdir -p ${cfg.stateDir}/log
mkdir -p ${cfg.stateDir}/satellites
mkdir -p ${cfg.stateDir}/repositories
mkdir -p ${cfg.stateDir}/shell/hooks
mkdir -p ${cfg.stateDir}/tmp/pids
mkdir -p ${cfg.stateDir}/tmp/sockets
rm -rf ${cfg.stateDir}/config
mkdir -p ${cfg.stateDir}/config
mkdir -p ${cfg.backupPath}
mkdir -p ${cfg.statePath}/builds
mkdir -p ${cfg.statePath}/repositories
mkdir -p ${gitlabConfig.production.shared.path}/artifacts
mkdir -p ${gitlabConfig.production.shared.path}/lfs-objects
mkdir -p ${cfg.statePath}/log
mkdir -p ${cfg.statePath}/shell
mkdir -p ${cfg.statePath}/tmp/pids
mkdir -p ${cfg.statePath}/tmp/sockets
rm -rf ${cfg.statePath}/config ${cfg.statePath}/shell/hooks
mkdir -p ${cfg.statePath}/config ${cfg.statePath}/shell
# TODO: What exactly is gitlab-shell doing with the secret?
tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 20 > ${cfg.stateDir}/config/gitlab_shell_secret
mkdir -p ${cfg.stateDir}/home/.ssh
touch ${cfg.stateDir}/home/.ssh/authorized_keys
tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 20 > ${cfg.statePath}/config/gitlab_shell_secret
cp -rf ${pkgs.gitlab}/share/gitlab/config ${cfg.stateDir}/
cp ${pkgs.gitlab}/share/gitlab/VERSION ${cfg.stateDir}/VERSION
# The uploads directory is hardcoded somewhere deep in rails. It is
# symlinked in the gitlab package to /run/gitlab/uploads to make it
# configurable
mkdir -p /run/gitlab
mkdir -p ${cfg.statePath}/uploads
ln -sf ${cfg.statePath}/uploads /run/gitlab/uploads
chown -R ${cfg.user}:${cfg.group} /run/gitlab
ln -fs ${pkgs.writeText "database.yml" databaseYml} ${cfg.stateDir}/config/database.yml
ln -fs ${pkgs.writeText "unicorn.rb" unicornConfig} ${cfg.stateDir}/config/unicorn.rb
# Prepare home directory
mkdir -p ${gitlabEnv.HOME}/.ssh
touch ${gitlabEnv.HOME}/.ssh/authorized_keys
chown -R ${cfg.user}:${cfg.group} ${gitlabEnv.HOME}/
chmod -R u+rwX,go-rwx+X ${gitlabEnv.HOME}/
chown -R gitlab:gitlab ${cfg.stateDir}/
chmod -R 755 ${cfg.stateDir}/
cp -rf ${cfg.packages.gitlab}/share/gitlab/config.dist/* ${cfg.statePath}/config
ln -sf ${cfg.statePath}/config /run/gitlab/config
cp ${cfg.packages.gitlab}/share/gitlab/VERSION ${cfg.statePath}/VERSION
# JSON is a subset of YAML
ln -fs ${pkgs.writeText "gitlab.yml" (builtins.toJSON gitlabConfig)} ${cfg.statePath}/config/gitlab.yml
ln -fs ${pkgs.writeText "database.yml" databaseYml} ${cfg.statePath}/config/database.yml
ln -fs ${pkgs.writeText "unicorn.rb" unicornConfig} ${cfg.statePath}/config/unicorn.rb
chown -R ${cfg.user}:${cfg.group} ${cfg.statePath}/
chmod -R ug+rwX,o-rwx+X ${cfg.statePath}/
# Install the shell required to push repositories
ln -fs ${pkgs.writeText "config.yml" gitlabShellYml} "$GITLAB_SHELL_CONFIG_PATH"
ln -fs ${cfg.packages.gitlab-shell}/hooks "$GITLAB_SHELL_HOOKS_PATH"
${cfg.packages.gitlab-shell}/bin/install
if [ "${cfg.databaseHost}" = "127.0.0.1" ]; then
if ! test -e "${cfg.stateDir}/db-created"; then
if ! test -e "${cfg.statePath}/db-created"; then
psql postgres -c "CREATE ROLE gitlab WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.databasePassword}'"
${config.services.postgresql.package}/bin/createdb --owner gitlab gitlab || true
touch "${cfg.stateDir}/db-created"
touch "${cfg.statePath}/db-created"
# force=yes disables the manual-interaction yes/no prompt
# which breaks without an stdin.
force=yes ${bundler}/bin/bundle exec rake -f ${pkgs.gitlab}/share/gitlab/Rakefile gitlab:setup RAILS_ENV=production
# The gitlab:setup task is horribly broken somehow, these two tasks will do the same for setting up the initial database
${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production
${gitlab-runner}/bin/gitlab-runner exec rake db:seed_fu RAILS_ENV=production \
GITLAB_ROOT_PASSWORD="${cfg.initialRootPassword}" GITLAB_ROOT_EMAIL="${cfg.initialRootEmail}";
fi
fi
${bundler}/bin/bundle exec rake -f ${pkgs.gitlab}/share/gitlab/Rakefile db:migrate RAILS_ENV=production
# Install the shell required to push repositories
ln -fs ${pkgs.writeText "config.yml" gitlabShellYml} ${cfg.stateDir}/shell/config.yml
export GITLAB_SHELL_CONFIG_PATH=""${cfg.stateDir}/shell/config.yml
${pkgs.gitlab-shell}/bin/install
# Always do the db migrations just to be sure the database is up-to-date
${gitlab-runner}/bin/gitlab-runner exec rake db:migrate RAILS_ENV=production
# Change permissions in the last step because some of the
# intermediary scripts like to create directories as root.
chown -R gitlab:gitlab ${cfg.stateDir}/
chmod -R 755 ${cfg.stateDir}/
# Change permissions in the last step because some of the
# intermediary scripts like to create directories as root.
chown -R ${cfg.user}:${cfg.group} ${cfg.statePath}
chmod -R u+rwX,go-rwx+X ${cfg.statePath}
'';
serviceConfig = {
PermissionsStartOnly = true; # preStart must be run as root
Type = "simple";
User = "gitlab";
Group = "gitlab";
User = cfg.user;
Group = cfg.group;
TimeoutSec = "300";
WorkingDirectory = "${pkgs.gitlab}/share/gitlab";
ExecStart="${bundler}/bin/bundle exec \"unicorn -c ${cfg.stateDir}/config/unicorn.rb -E production\"";
WorkingDirectory = "${cfg.packages.gitlab}/share/gitlab";
ExecStart="${bundler}/bin/bundle exec \"unicorn -c ${cfg.statePath}/config/unicorn.rb -E production\"";
};
};

View file

@ -0,0 +1,103 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="module-services-gitlab">
<title>Gitlab</title>
<para>Gitlab is a feature-rich git hosting service.</para>
<section><title>Prerequisites</title>
<para>The gitlab service exposes only an Unix socket at
<literal>/run/gitlab/gitlab-workhorse.socket</literal>. You need to configure a
webserver to proxy HTTP requests to the socket.</para>
<para>For instance, this could be used for Nginx:
<programlisting>
services.nginx.httpConfig = ''
server {
server_name git.example.com;
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
ssl_certificate /var/lib/acme/git.example.com/fullchain.pem;
ssl_certificate_key /var/lib/acme/git.example.com/key.pem;
location / {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/run/gitlab/gitlab-workhorse.socket;
}
}
'';
</programlisting>
</para>
</section>
<section><title>Configuring</title>
<para>Gitlab depends on both PostgreSQL and Redis and will automatically enable
both services. In the case of PostgreSQL, a database and a role will be created.
</para>
<para>The default state dir is /var/gitlab/state. This is where all data like
the repositories and uploads will be stored.</para>
<para>A basic configuration could look like this:
<programlisting>
services.gitlab = {
enable = true;
databasePassword = "eXaMpl3";
initialRootPassword = "UseNixOS!";
https = true;
host = "git.example.com";
port = 443;
user = "git";
group = "git";
extraConfig = {
gitlab = {
default_projects_features = { builds = false; };
};
};
};
</programlisting>
</para>
<para>Refer to <xref linkend="ch-options" /> for all available configuration
options for the <literal>services.gitlab</literal> module.</para>
</section>
<section><title>Maintenance</title>
<para>You can run all Gitlab related commands like rake tasks with
<literal>gitlab-runner</literal> which will be available on the system
when gitlab is enabled. You will have to run the commands as the user that
you configured to run gitlab.</para>
<para>For instance, to backup a Gitlab instance:
<programlisting>
$ sudo -u git -H gitlab-runner exec rake gitlab:backup:create
</programlisting>
A list of all availabe rake tasks can be obtained by running:
<programlisting>
$ sudo -u git -H gitlab-runner exec rake -T
</programlisting>
</para>
</section>
</chapter>

View file

@ -367,6 +367,8 @@ in
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-certificates.crt"; }
// config.networking.proxy.envVars;
unitConfig.RequiresMountsFor = "/nix/store";
serviceConfig =
{ Nice = cfg.daemonNiceLevel;
IOSchedulingPriority = cfg.daemonIONiceLevel;

View file

@ -72,7 +72,8 @@ in
};
services.nixosManual.ttyNumber = mkOption {
default = "8";
type = types.int;
default = 8;
description = ''
Virtual console on which to show the manual.
'';
@ -96,7 +97,7 @@ in
[ manual.manual help ]
++ optional config.programs.man.enable manual.manpages;
boot.extraTTYs = mkIf cfg.showManual ["tty${cfg.ttyNumber}"];
boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"];
systemd.services = optionalAttrs cfg.showManual
{ "nixos-manual" =
@ -106,7 +107,7 @@ in
{ ExecStart = "${cfg.browser} ${entry}";
StandardInput = "tty";
StandardOutput = "tty";
TTYPath = "/dev/tty${cfg.ttyNumber}";
TTYPath = "/dev/tty${toString cfg.ttyNumber}";
TTYReset = true;
TTYVTDisallocate = true;
Restart = "always";

View file

@ -0,0 +1,22 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.hdapsd;
hdapsd = [ pkgs.hdapsd ];
in
{
options = {
services.hdapsd.enable = mkEnableOption
''
Hard Drive Active Protection System Daemon,
devices are detected and managed automatically by udev and systemd
'';
};
config = mkIf cfg.enable {
services.udev.packages = hdapsd;
systemd.packages = hdapsd;
};
}

View file

@ -0,0 +1,150 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.services.netatalk;
extmapFile = pkgs.writeText "extmap.conf" cfg.extmap;
afpToString = x: if builtins.typeOf x == "bool"
then (if x then "true" else "false")
else toString x;
volumeConfig = name:
let vol = getAttr name cfg.volumes; in
"[${name}]\n " + (toString (
map
(key: "${key} = ${afpToString (getAttr key vol)}\n")
(attrNames vol)
));
afpConf = ''[Global]
extmap file = ${extmapFile}
afp port = ${toString cfg.port}
${cfg.extraConfig}
${if cfg.homes.enable then ''[Homes]
${optionalString (cfg.homes.path != "") "path = ${cfg.homes.path}"}
basedir regex = ${cfg.homes.basedirRegex}
${cfg.homes.extraConfig}
'' else ""}
${toString (map volumeConfig (attrNames cfg.volumes))}
'';
afpConfFile = pkgs.writeText "afp.conf" afpConf;
in
{
options = {
services.netatalk = {
enable = mkOption {
default = false;
description = "Whether to enable the Netatalk AFP fileserver.";
};
port = mkOption {
default = 548;
description = "TCP port to be used for AFP.";
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = "uam list = uams_guest.so";
description = ''
Lines of configuration to add to the <literal>[Global]</literal> section.
See <literal>man apf.conf</literal> for more information.
'';
};
homes = {
enable = mkOption {
default = false;
description = "Enable sharing of the UNIX server user home directories.";
};
path = mkOption {
default = "";
example = "afp-data";
description = "Share not the whole user home but this subdirectory path.";
};
basedirRegex = mkOption {
example = "/home";
description = "Regex which matches the parent directory of the user homes.";
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = ''
Lines of configuration to add to the <literal>[Homes]</literal> section.
See <literal>man apf.conf</literal> for more information.
'';
};
};
volumes = mkOption {
default = { };
type = types.attrsOf (types.attrsOf types.unspecified);
description =
''
Set of AFP volumes to export.
See <literal>man apf.conf</literal> for more information.
'';
example =
{ srv =
{ path = "/srv";
"read only" = true;
"hosts allow" = "10.1.0.0/16 10.2.1.100 2001:0db8:1234::/48";
};
};
};
extmap = mkOption {
type = types.lines;
default = "";
description = ''
File name extension mappings.
See <literal>man extmap.conf</literal> for more information.
'';
};
};
};
config = mkIf cfg.enable {
systemd.services.netatalk = {
description = "Netatalk AFP fileserver for Macintosh clients";
unitConfig.Documentation = "man:afp.conf(5) man:netatalk(8) man:afpd(8) man:cnid_metad(8) man:cnid_dbd(8)";
after = [ "network.target" "avahi-daemon.service" ];
wantedBy = [ "multi-user.target" ];
path = [ pkgs.netatalk ];
serviceConfig = {
Type = "forking";
GuessMainPID = "no";
PIDFile = "/run/lock/netatalk";
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -m 0755 -p /var/lib/netatalk/CNID";
ExecStart = "${pkgs.netatalk}/sbin/netatalk -F ${afpConfFile}";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ExecStop = "${pkgs.coreutils}/bin/kill -TERM $MAINPID";
Restart = "always";
RestartSec = 1;
};
};
security.pam.services.netatalk.unixAuth = true;
};
}

View file

@ -79,6 +79,14 @@ in
description = ''
Whether to enable Samba, which provides file and print
services to Windows clients through the SMB/CIFS protocol.
<note>
<para>If you use the firewall consider adding the following:</para>
<programlisting>
networking.firewall.allowedTCPPorts = [ 139 445 ];
networking.firewall.allowedUDPPorts = [ 137 138 ];
</programlisting>
</note>
'';
};
@ -86,7 +94,7 @@ in
type = types.package;
default = pkgs.samba;
defaultText = "pkgs.samba";
example = literalExample "pkgs.samba4";
example = literalExample "pkgs.samba3";
description = ''
Defines which package should be used for the samba server.
'';
@ -118,6 +126,10 @@ in
description = ''
Additional global section and extra section lines go in here.
'';
example = ''
guest account = nobody
map to guest = bad user
'';
};
configText = mkOption {
@ -154,9 +166,11 @@ in
'';
type = types.attrsOf (types.attrsOf types.unspecified);
example =
{ srv =
{ path = "/srv";
{ public =
{ path = "/srv/public";
"read only" = true;
browseable = "yes";
"guest ok" = "yes";
comment = "Public samba share.";
};
};

View file

@ -54,7 +54,7 @@ rec {
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.pythonPackages; [
python twisted pycrypto pyasn1 ];
python twisted_11 pycrypto pyasn1 ];
environment.etc."kippo.cfg".text = ''
# Automatically generated by NixOS.
@ -84,7 +84,7 @@ rec {
description = "Kippo Web Server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
environment.PYTHONPATH = "${pkgs.kippo}/src/:${pkgs.pythonPackages.pycrypto}/lib/python2.7/site-packages/:${pkgs.pythonPackages.pyasn1}/lib/python2.7/site-packages/:${pkgs.pythonPackages.python}/lib/python2.7/site-packages/:${pkgs.pythonPackages.twisted}/lib/python2.7/site-packages/:.";
environment.PYTHONPATH = "${pkgs.kippo}/src/:${pkgs.pythonPackages.pycrypto}/lib/python2.7/site-packages/:${pkgs.pythonPackages.pyasn1}/lib/python2.7/site-packages/:${pkgs.pythonPackages.python}/lib/python2.7/site-packages/:${pkgs.pythonPackages.twisted_11}/lib/python2.7/site-packages/:.";
preStart = ''
if [ ! -d ${cfg.varPath}/ ] ; then
mkdir -p ${cfg.logPath}/tty
@ -107,7 +107,7 @@ rec {
fi
'';
serviceConfig.ExecStart = "${pkgs.pythonPackages.twisted}/bin/twistd -y ${pkgs.kippo}/src/kippo.tac --syslog --rundir=${cfg.varPath}/ --pidfile=${cfg.pidPath}/kippo.pid --prefix=kippo -n";
serviceConfig.ExecStart = "${pkgs.pythonPackages.twisted_11}/bin/twistd -y ${pkgs.kippo}/src/kippo.tac --syslog --rundir=${cfg.varPath}/ --pidfile=${cfg.pidPath}/kippo.pid --prefix=kippo -n";
serviceConfig.PermissionsStartOnly = true;
serviceConfig.User = "kippo";
serviceConfig.Group = "kippo";

View file

@ -228,6 +228,11 @@ in {
users.extraUsers = [{
name = "nm-openvpn";
uid = config.ids.uids.nm-openvpn;
}
{
# to enable link-local connections
name = "avahi-autoipd";
uid = config.ids.uids.avahi-autoipd;
}];
systemd.packages = cfg.packages;

View file

@ -304,7 +304,7 @@ in
services.openssh.authorizedKeysFiles =
[ ".ssh/authorized_keys" ".ssh/authorized_keys2" "/etc/ssh/authorized_keys.d/%u" ];
services.openssh.extraConfig =
services.openssh.extraConfig = mkOrder 0
''
PidFile /run/sshd.pid

View file

@ -310,7 +310,7 @@ in
[ ! -e "/var/lib/cups/$i" ] && ln -s "${rootdir}/etc/cups/$i" "/var/lib/cups/$i"
done
${optionalString cfg.gutenprint ''
${gutenprint}/bin/cups-genppdupdate
${gutenprint}/bin/cups-genppdupdate -p /etc/cups/ppd
''}
'';
};

View file

@ -5,44 +5,86 @@ with lib;
let
cfg = config.services.uwsgi;
python2Pkgs = pkgs.python2Packages.override {
python = pkgs.uwsgi.python2;
self = python2Pkgs;
};
python3Pkgs = pkgs.python3Packages.override {
python = pkgs.uwsgi.python3;
self = python3Pkgs;
};
buildCfg = c: if builtins.typeOf c != "set" then builtins.readFile c else builtins.toJSON {
uwsgi =
if c.type == "normal"
then {
pythonpath =
(if c ? python2Packages
then builtins.map (x: "${x}/${pkgs.uwsgi.python2.sitePackages}") (c.python2Packages python2Pkgs)
else [])
++ (if c ? python3Packages
then builtins.map (x: "${x}/${pkgs.uwsgi.python3.sitePackages}") (c.python3Packages python3Pkgs)
else []);
plugins = cfg.plugins;
} // removeAttrs c [ "type" "python2Packages" "python3Packages" ]
else if c.type == "emperor"
then {
emperor = if builtins.typeOf c.vassals != "set" then c.vassals
else pkgs.buildEnv {
name = "vassals";
paths = mapAttrsToList (n: c: pkgs.writeTextDir "${n}.json" (buildCfg c)) c.vassals;
};
} // removeAttrs c [ "type" "vassals" ]
else abort "type should be either 'normal' or 'emperor'";
};
uwsgi = pkgs.uwsgi.override {
plugins = cfg.plugins;
};
buildCfg = name: c:
let
plugins =
if any (n: !any (m: m == n) cfg.plugins) (c.plugins or [])
then throw "`plugins` attribute in UWSGI configuration contains plugins not in config.services.uwsgi.plugins"
else c.plugins or cfg.plugins;
hasPython = v: filter (n: n == "python${v}") plugins != [];
hasPython2 = hasPython "2";
hasPython3 = hasPython "3";
python =
if hasPython2 && hasPython3 then
throw "`plugins` attribute in UWSGI configuration shouldn't contain both python2 and python3"
else if hasPython2 then uwsgi.python2
else if hasPython3 then uwsgi.python3
else null;
pythonPackages = pkgs.pythonPackages.override {
inherit python;
self = pythonPackages;
};
json = builtins.toJSON {
uwsgi =
if c.type == "normal"
then {
inherit plugins;
} // removeAttrs c [ "type" "pythonPackages" ]
// optionalAttrs (python != null) {
pythonpath = "@PYTHONPATH@";
env = (c.env or {}) // {
PATH = optionalString (c ? env.PATH) "${c.env.PATH}:" + "@PATH@";
};
}
else if c.type == "emperor"
then {
emperor = if builtins.typeOf c.vassals != "set" then c.vassals
else pkgs.buildEnv {
name = "vassals";
paths = mapAttrsToList buildCfg c.vassals;
};
} // removeAttrs c [ "type" "vassals" ]
else throw "`type` attribute in UWSGI configuration should be either 'normal' or 'emperor'";
};
in
if python == null || c.type != "normal"
then pkgs.writeTextDir "${name}.json" json
else pkgs.stdenv.mkDerivation {
name = "uwsgi-config";
inherit json;
passAsFile = [ "json" ];
nativeBuildInputs = [ pythonPackages.wrapPython ];
pythonInputs = (c.pythonPackages or (self: [])) pythonPackages;
buildCommand = ''
mkdir $out
declare -A pythonPathsSeen=()
program_PYTHONPATH=
program_PATH=
if [ -n "$pythonInputs" ]; then
for i in $pythonInputs; do
_addToPythonPath $i
done
fi
# A hack to replace "@PYTHONPATH@" with a JSON list
if [ -n "$program_PYTHONPATH" ]; then
program_PYTHONPATH="\"''${program_PYTHONPATH//:/\",\"}\""
fi
substitute $jsonPath $out/${name}.json \
--replace '"@PYTHONPATH@"' "[$program_PYTHONPATH]" \
--subst-var-by PATH "$program_PATH"
'';
};
in {
options = {
@ -71,21 +113,24 @@ in {
vassals = {
moin = {
type = "normal";
python2Packages = self: with self; [ moinmoin ];
pythonPackages = self: with self; [ moinmoin ];
socket = "${config.services.uwsgi.runDir}/uwsgi.sock";
};
};
}
'';
description = ''
uWSGI configuration. This awaits either a path to file or a set which will be made into one.
If given a set, it awaits an attribute <literal>type</literal> which can be either <literal>normal</literal>
or <literal>emperor</literal>.
uWSGI configuration. It awaits an attribute <literal>type</literal> inside which can be either
<literal>normal</literal> or <literal>emperor</literal>.
For <literal>normal</literal> mode you can specify <literal>pythonPackages</literal> as a function
from libraries set into a list of libraries. <literal>pythonpath</literal> will be set accordingly.
For <literal>normal</literal> mode you can specify <literal>python2Packages</literal> and
<literal>python3Packages</literal> as functions from libraries set into lists of libraries.
For <literal>emperor</literal> mode, you should use <literal>vassals</literal> attribute
which should be either a set of names and configurations or a path to a directory.
Other attributes will be used in configuration file as-is. Notice that you can redefine
<literal>plugins</literal> setting here.
'';
};
@ -118,7 +163,7 @@ in {
'';
serviceConfig = {
Type = "notify";
ExecStart = "${uwsgi}/bin/uwsgi --uid ${cfg.user} --gid ${cfg.group} --json ${pkgs.writeText "uwsgi.json" (buildCfg cfg.instance)}";
ExecStart = "${uwsgi}/bin/uwsgi --uid ${cfg.user} --gid ${cfg.group} --json ${buildCfg "server" cfg.instance}/server.json";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
ExecStop = "${pkgs.coreutils}/bin/kill -INT $MAINPID";
NotifyAccess = "main";

View file

@ -0,0 +1,235 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.xserver.libinput;
xorgBool = v: if v then "on" else "off";
in {
options = {
services.xserver.libinput = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = "Whether to enable libinput support.";
};
dev = mkOption {
type = types.nullOr types.str;
default = null;
example = "/dev/input/event0";
description =
''
Path for touchpad device. Set to null to apply to any
auto-detected touchpad.
'';
};
accelProfile = mkOption {
type = types.enum [ "flat" "adaptive" ];
default = "flat";
example = "adaptive";
description =
''
Sets the pointer acceleration profile to the given profile. Permitted values are adaptive, flat.
Not all devices support this option or all profiles. If a profile is unsupported, the default profile
for this is used. For a description on the profiles and their behavior, see the libinput documentation.
'';
};
accelSpeed = mkOption {
type = types.nullOr types.string;
default = null;
description = "Cursor acceleration (how fast speed increases from minSpeed to maxSpeed).";
};
buttonMapping = mkOption {
type = types.nullOr types.string;
default = null;
description =
''
Sets the logical button mapping for this device, see XSetPointerMapping(3). The string must
be a space-separated list of button mappings in the order of the logical buttons on the
device, starting with button 1. The default mapping is "1 2 3 ... 32". A mapping of 0 deac
tivates the button. Multiple buttons can have the same mapping. Invalid mapping strings are
discarded and the default mapping is used for all buttons. Buttons not specified in the
user's mapping use the default mapping. See section BUTTON MAPPING for more details.
'';
};
calibrationMatrix = mkOption {
type = types.nullOr types.string;
default = null;
description =
''
A string of 9 space-separated floating point numbers. Sets the calibration matrix to the
3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi).
'';
};
clickMethod = mkOption {
type = types.nullOr (types.enum [ "none" "buttonareas" "clickfinger" ]);
default = null;
example = "none";
description =
''
Enables a click method. Permitted values are none, buttonareas, clickfinger.
Not all devices support all methods, if an option is unsupported,
the default click method for this device is used.
'';
};
leftHanded = mkOption {
type = types.bool;
default = false;
example = true;
description = "Enables left-handed button orientation, i.e. swapping left and right buttons.";
};
middleEmulation = mkOption {
type = types.bool;
default = true;
example = false;
description =
''
Enables middle button emulation. When enabled, pressing the left and right buttons
simultaneously produces a middle mouse button click.
'';
};
naturalScrolling = mkOption {
type = types.bool;
default = false;
example = true;
description = "Enables or disables natural scrolling behavior.";
};
scrollButton = mkOption {
type = types.nullOr types.int;
default = null;
example = 1;
description =
''
Designates a button as scroll button. If the ScrollMethod is button and the button is logically
held down, x/y axis movement is converted into scroll events.
'';
};
scrollMethod = mkOption {
type = types.enum [ "twofinger" "edge" "none" ];
default = "twofinger";
example = "edge";
description =
''
Specify the scrolling method.
'';
};
horizontalScrolling = mkOption {
type = types.bool;
default = true;
example = false;
description =
''
Disables horizontal scrolling. When disabled, this driver will discard any horizontal scroll
events from libinput. Note that this does not disable horizontal scrolling, it merely
discards the horizontal axis from any scroll events.
'';
};
sendEventsMode = mkOption {
type = types.enum [ "disabled" "enabled" "disabled-on-external-mouse" ];
default = "enabled";
example = "disabled";
description =
''
Sets the send events mode to disabled, enabled, or "disable when an external mouse is connected".
'';
};
tapping = mkOption {
type = types.bool;
default = true;
example = false;
description =
''
Enables or disables tap-to-click behavior.
'';
};
tappingDragLock = mkOption {
type = types.bool;
default = true;
example = false;
description =
''
Enables or disables drag lock during tapping behavior. When enabled, a finger up during tap-
and-drag will not immediately release the button. If the finger is set down again within the
timeout, the draging process continues.
'';
};
disableWhileTyping = mkOption {
type = types.bool;
default = true;
example = false;
description =
''
Disable input method while typing.
'';
};
additionalOptions = mkOption {
type = types.str;
default = "";
example =
''
Option "DragLockButtons" "L1 B1 L2 B2"
'';
description = "Additional options for libinput touchpad driver.";
};
};
};
config = mkIf cfg.enable {
services.xserver.modules = [ pkgs.xorg.xf86inputlibinput ];
environment.systemPackages = [ pkgs.xorg.xf86inputlibinput ];
services.xserver.config =
''
# Automatically enable the libinput driver for all touchpads.
Section "InputClass"
Identifier "libinputConfiguration"
MatchIsTouchpad "on"
${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''}
Driver "libinput"
Option "AccelProfile" "${cfg.accelProfile}"
${optionalString (cfg.accelSpeed != null) ''Option "AccelSpeed" "${cfg.accelSpeed}"''}
${optionalString (cfg.buttonMapping != null) ''Option "ButtonMapping" "${cfg.buttonMapping}"''}
${optionalString (cfg.calibrationMatrix != null) ''Option "CalibrationMatrix" "${cfg.calibrationMatrix}"''}
${optionalString (cfg.clickMethod != null) ''Option "ClickMethod" "${cfg.clickMethod}"''}
Option "LeftHanded" "${xorgBool cfg.leftHanded}"
Option "MiddleEmulation" "${xorgBool cfg.middleEmulation}"
Option "NaturalScrolling" "${xorgBool cfg.naturalScrolling}"
${optionalString (cfg.scrollButton != null) ''Option "ScrollButton" "${cfg.scrollButton}"''}
Option "ScrollMethod" "${cfg.scrollMethod}"
Option "HorizontalScrolling" "${xorgBool cfg.horizontalScrolling}"
Option "SendEventsMode" "${cfg.sendEventsMode}"
Option "Tapping" "${xorgBool cfg.tapping}"
Option "TappingDragLock" "${xorgBool cfg.tappingDragLock}"
Option "DisableWhileTyping" "${xorgBool cfg.disableWhileTyping}"
${cfg.additionalOptions}
EndSection
'';
};
}

View file

@ -8,7 +8,7 @@ in
{
options = {
services.xserver.windowManager.openbox.enable = mkEnableOption "oroborus";
services.xserver.windowManager.openbox.enable = mkEnableOption "openbox";
};
config = mkIf cfg.enable {

View file

@ -261,12 +261,12 @@ while (my ($unit, $state) = each %{$activePrev}) {
sub pathToUnitName {
my ($path) = @_;
die unless substr($path, 0, 1) eq "/";
return "-" if $path eq "/";
$path = substr($path, 1);
$path =~ s/\//-/g;
# FIXME: handle - and unprintable characters.
return $path;
open my $cmd, "-|", "systemd-escape", "--suffix=mount", "-p", $path
or die "Unable to escape $path!\n";
my $escaped = join "", <$cmd>;
chomp $escaped;
close $cmd or die;
return $escaped;
}
sub unique {
@ -290,7 +290,7 @@ my ($newFss, $newSwaps) = parseFstab "$out/etc/fstab";
foreach my $mountPoint (keys %$prevFss) {
my $prev = $prevFss->{$mountPoint};
my $new = $newFss->{$mountPoint};
my $unit = pathToUnitName($mountPoint) . ".mount";
my $unit = pathToUnitName($mountPoint);
if (!defined $new) {
# Filesystem entry disappeared, so unmount it.
$unitsToStop{$unit} = 1;

View file

@ -71,6 +71,23 @@ mount -t devtmpfs -o "size=@devSize@" devtmpfs /dev
mkdir -p /run
mount -t tmpfs -o "mode=0755,size=@runSize@" tmpfs /run
# Log the script output to /dev/kmsg or /run/log/stage-1-init.log.
mkdir -p /tmp
mkfifo /tmp/stage-1-init.log.fifo
logOutFd=8 && logErrFd=9
eval "exec $logOutFd>&1 $logErrFd>&2"
if test -w /dev/kmsg; then
tee -i < /tmp/stage-1-init.log.fifo /proc/self/fd/"$logOutFd" | while read -r line; do
if test -n "$line"; then
echo "<7>stage-1-init: $line" > /dev/kmsg
fi
done &
else
mkdir -p /run/log
tee -i < /tmp/stage-1-init.log.fifo /run/log/stage-1-init.log &
fi
exec > /tmp/stage-1-init.log.fifo 2>&1
# Process the kernel command line.
export stage2Init=/init
@ -415,6 +432,14 @@ fi
# Stop udevd.
udevadm control --exit
# Reset the logging file descriptors.
# Do this just before pkill, which will kill the tee process.
if test -n "@logCommands@"
then
exec 1>&$logOutFd 2>&$logErrFd
eval "exec $logOutFd>&- $logErrFd>&-"
fi
# 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.
pkill -9 -v -f '@'

View file

@ -155,6 +155,21 @@ mkdir -m 0755 -p /var/setuid-wrappers
mount -t tmpfs -o "mode=0755" tmpfs /var/setuid-wrappers
# Log the script output to /dev/kmsg or /run/log/stage-2-init.log.
# Only at this point are all the necessary prerequisites ready for these commands.
exec {logOutFd}>&1 {logErrFd}>&2
if test -w /dev/kmsg; then
exec > >(tee -i /proc/self/fd/"$logOutFd" | while read -r line; do
if test -n "$line"; then
echo "<7>stage-2-init: $line" > /dev/kmsg
fi
done) 2>&1
else
mkdir -p /run/log
exec > >(tee -i /run/log/stage-2-init.log) 2>&1
fi
# Run the script that performs all configuration activation that does
# not have to be done at boot time.
echo "running activation script..."
@ -182,6 +197,11 @@ ln -sfn /run/booted-system /nix/var/nix/gcroots/booted-system
@shell@ @postBootCommands@
# Reset the logging file descriptors.
exec 1>&$logOutFd 2>&$logErrFd
exec {logOutFd}>&- {logErrFd}>&-
# Start systemd.
echo "starting systemd..."
PATH=/run/current-system/systemd/lib/systemd \

View file

@ -20,7 +20,15 @@ let kernel = config.boot.kernelPackages.kernel; in
export USER=root
export HOME=/root
export DISPLAY=:0.0
source /etc/profile
# Don't use a pager when executing backdoor
# actions. Because we use a tty, commands like systemctl
# or nix-store get confused into thinking they're running
# interactively.
export PAGER=
cd /tmp
exec < /dev/hvc0 > /dev/hvc0
while ! exec 2> /dev/ttyS0; do sleep 0.1; done
@ -38,11 +46,6 @@ let kernel = config.boot.kernelPackages.kernel; in
systemd.services."serial-getty@ttyS0".enable = false;
systemd.services."serial-getty@hvc0".enable = false;
# Don't use a pager when executing backdoor actions. Because we
# use a tty, commands like systemctl or nix-store get confused
# into thinking they're running interactively.
environment.variables.PAGER = "";
boot.initrd.preDeviceCommands =
''
echo 600 > /proc/sys/kernel/hung_task_timeout_secs

View file

@ -9,10 +9,10 @@ let
waagent = with pkgs; stdenv.mkDerivation rec {
name = "waagent-2.0";
src = pkgs.fetchFromGitHub {
owner = "phreedom";
owner = "Azure";
repo = "WALinuxAgent";
rev = "1d31fe8cbc7f842993eed9b33a3d3f5410c364e3";
sha256 = "1s53pfmy3azp0rmympmnphyq96sr9jy07pbsfza6mdzpalx1ripl";
rev = "1b3a8407a95344d9d12a2a377f64140975f1e8e4";
sha256 = "10byzvmpgrmr4d5mdn2kq04aapqb3sgr1admk13wjmy5cd6bwd2x";
};
buildInputs = [ makeWrapper python pythonPackages.wrapPython ];
runtimeDeps = [ findutils gnugrep gawk coreutils openssl openssh

View file

@ -16,14 +16,14 @@ in
cyl=$(((${diskSize}*1024*1024)/(512*63*255)))
size=$(($cyl*255*63*512))
roundedsize=$((($size/(1024*1024)+1)*(1024*1024)))
${pkgs.vmTools.qemu}/bin/qemu-img create -f raw $diskImage $roundedsize
${pkgs.vmTools.qemu-220}/bin/qemu-img create -f raw $diskImage $roundedsize
mv closure xchg/
'';
postVM =
''
mkdir -p $out
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -O vpc -o subformat=fixed $diskImage $out/disk.vhd
${pkgs.vmTools.qemu-220}/bin/qemu-img convert -f raw -O vpc -o subformat=fixed $diskImage $out/disk.vhd
rm $diskImage
'';
diskImageBase = "nixos-image-${config.system.nixosLabel}-${pkgs.stdenv.system}.raw";

View file

@ -0,0 +1,14 @@
diff --git a/Makefile b/Makefile
index d6b9dc1..ce7c493 100644
--- a/Makefile
+++ b/Makefile
@@ -384,8 +384,7 @@ install-confdir:
install-sysconfig: install-datadir install-confdir
$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(qemu_confdir)"
-install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
-install-datadir install-localstatedir
+install: all $(if $(BUILD_DOCS),install-doc) install-datadir
ifneq ($(TOOLS),)
$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
endif

View file

@ -43,18 +43,20 @@ with lib;
mkdir -m 0755 -p /etc/ssh
key="$(sed 's/|/\n/g; s/SSH_HOST_DSA_KEY://; t; d' $userData)"
key_pub="$(sed 's/SSH_HOST_DSA_KEY_PUB://; t; d' $userData)"
if [ -n "$key" -a -n "$key_pub" -a ! -e /etc/ssh/ssh_host_dsa_key ]; then
(umask 077; echo "$key" > /etc/ssh/ssh_host_dsa_key)
echo "$key_pub" > /etc/ssh/ssh_host_dsa_key.pub
fi
if [ -s "$userData" ]; then
key="$(sed 's/|/\n/g; s/SSH_HOST_DSA_KEY://; t; d' $userData)"
key_pub="$(sed 's/SSH_HOST_DSA_KEY_PUB://; t; d' $userData)"
if [ -n "$key" -a -n "$key_pub" -a ! -e /etc/ssh/ssh_host_dsa_key ]; then
(umask 077; echo "$key" > /etc/ssh/ssh_host_dsa_key)
echo "$key_pub" > /etc/ssh/ssh_host_dsa_key.pub
fi
key="$(sed 's/|/\n/g; s/SSH_HOST_ED25519_KEY://; t; d' $userData)"
key_pub="$(sed 's/SSH_HOST_ED25519_KEY_PUB://; t; d' $userData)"
if [ -n "$key" -a -n "$key_pub" -a ! -e /etc/ssh/ssh_host_ed25519_key ]; then
(umask 077; echo "$key" > /etc/ssh/ssh_host_ed25519_key)
echo "$key_pub" > /etc/ssh/ssh_host_ed25519_key.pub
key="$(sed 's/|/\n/g; s/SSH_HOST_ED25519_KEY://; t; d' $userData)"
key_pub="$(sed 's/SSH_HOST_ED25519_KEY_PUB://; t; d' $userData)"
if [ -n "$key" -a -n "$key_pub" -a ! -e /etc/ssh/ssh_host_ed25519_key ]; then
(umask 077; echo "$key" > /etc/ssh/ssh_host_ed25519_key)
echo "$key_pub" > /etc/ssh/ssh_host_ed25519_key.pub
fi
fi
'';

View file

@ -78,7 +78,7 @@ import ./make-test.nix ({pkgs, ... }: {
# (showing that the right filters have been applied). Of
# course, since there is no actual USB printer attached, the
# file will stay in the queue forever.
$server->waitForFile("/var/spool/cups/d00001-001");
$server->waitForFile("/var/spool/cups/d*-001");
$server->sleep(10);
$server->succeed("lpq -a") =~ /$fn/ or die;
@ -90,6 +90,9 @@ import ./make-test.nix ({pkgs, ... }: {
Machine::retry sub {
return 1 if $server->succeed("lpq -a") =~ /no entries/;
};
# The queue is empty already, so this should be safe.
# Otherwise, pairs of "c*"-"d*-001" files might persist.
$server->execute("rm /var/spool/cups/*");
};
}
'';

View file

@ -1,23 +1,23 @@
{ stdenv, fetchurl, pkgconfig, autoreconfHook, openssl, db48, boost
, zlib, miniupnpc, qt4, utillinux, protobuf, qrencode
, zlib, miniupnpc, qt4, utillinux, protobuf, qrencode, libevent
, withGui }:
with stdenv.lib;
stdenv.mkDerivation rec{
name = "bitcoin" + (toString (optional (!withGui) "d")) + "-" + version;
core_version = "0.11.0";
core_version = "0.12.0";
version = core_version;
src = fetchurl {
urls = [ "https://bitcoin.org/bin/bitcoin-core-${core_version}/bitcoin-${version}.tar.gz"
"mirror://sourceforge/bitcoin/Bitcoin/bitcoin-${core_version}/bitcoin-${version}.tar.gz"
];
sha256 = "51ba1756addfa71567559e3f22331c1d908a63571891287689fff7113035d09f";
sha256 = "0f1cda66c841a548a07cc37e80b0727354b1236d9f374c7d44362acdb85eb3e1";
};
buildInputs = [ pkgconfig autoreconfHook openssl db48 boost zlib
miniupnpc protobuf ]
miniupnpc protobuf libevent]
++ optionals stdenv.isLinux [ utillinux ]
++ optionals withGui [ qt4 qrencode ];

View file

@ -1,9 +1,9 @@
{ stdenv, fetchurl, buildPythonPackage, pythonPackages, mygpoclient, intltool
{ stdenv, fetchurl, buildPythonApplication, pythonPackages, mygpoclient, intltool
, ipodSupport ? true, libgpod
, gnome3
}:
buildPythonPackage rec {
buildPythonApplication rec {
name = "gpodder-${version}";
namePrefix = "";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages, gettext, klick}:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "gtklick-${version}";
namePrefix = "";
version = "0.6.4";

View file

@ -1,14 +1,15 @@
{ stdenv, fetchgit, xorg, freetype, alsaLib, libjack2
, lv2, pkgconfig, mesa }:
{ stdenv, fetchurl, xorg, freetype, alsaLib, libjack2
, lv2, pkgconfig, mesa }:
stdenv.mkDerivation rec {
name = "helm-git-2015-09-11";
stdenv.mkDerivation rec {
version = "0.6.1";
name = "helm-${version}";
src = fetchurl {
url = "https://github.com/mtytel/helm/archive/v${version}.tar.gz";
sha256 = "18d7zx6r7har47zj6x1f2z91x796mxnix7w3x1yilmqnyqc56r3w";
};
src = fetchgit {
url = "https://github.com/mtytel/helm.git";
rev = "ad798d4a0a2e7db52e1a7451176ff198a393cdb4";
sha256 = "0ic4xjikq7s2p53507ykv89844j6sqcd9mh3y59a6wnslr5wq1cw";
};
buildInputs = [
xorg.libX11 xorg.libXcomposite xorg.libXcursor xorg.libXext

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "lastfmsubmitd-${version}";
namePrefix = "";
version = "1.0.6";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchgit, pythonPackages }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "lastwatch-${version}";
namePrefix = "";
version = "0.4.1";

View file

@ -1,19 +1,21 @@
{ stdenv, fetchurl, SDL, alsaLib, cmake, fftwSinglePrec, fluidsynth
{ stdenv, fetchFromGitHub, SDL, alsaLib, cmake, fftwSinglePrec, fluidsynth
, fltk13, libjack2, libvorbis , libsamplerate, libsndfile, pkgconfig
, libpulseaudio, qt4, freetype
, libpulseaudio, qt4, freetype, libgig
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "lmms-${version}";
version = "1.1.3";
version = "1.1.90";
src = fetchurl {
url = "https://github.com/LMMS/lmms/archive/v${version}.tar.gz";
sha256 = "1g76z7ha3hd53vbqaq9n1qg6s3lw8zzaw51iny6y2bz0j1xqwcsr";
src = fetchFromGitHub {
owner = "LMMS";
repo = "lmms";
rev = "v${version}";
sha256 = "0njiarndwqamqiinr1wbwkzjn87yzr1z5k9cfwk0jdkbalgakkq3";
};
buildInputs = [
SDL alsaLib cmake fftwSinglePrec fltk13 fluidsynth libjack2
SDL alsaLib cmake fftwSinglePrec fltk13 fluidsynth libjack2 libgig
libsamplerate libsndfile libvorbis pkgconfig libpulseaudio qt4
];

View file

@ -2,7 +2,7 @@
let version = "3.2";
in
pythonPackages.buildPythonPackage {
pythonPackages.buildPythonApplication {
name = "mimms-${version}";
src = fetchurl {
url = "http://download.savannah.gnu.org/releases/mimms/mimms-${version}.tar.bz2";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-gmusic-${version}";
version = "1.0.0";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-moped-${version}";
version = "0.6.0";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-mopify-${version}";
version = "1.5.8";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-musicbox-webclient-${version}";
version = "2.0.0";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-soundcloud-${version}";
version = "2.0.2";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, pythonPackages, mopidy, mopidy-spotify }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-spotify-tunigo-${version}";
version = "0.2.1";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-spotify-${version}";
version = "2.3.1";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, pythonPackages, mopidy }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-youtube-${version}";
version = "2.0.1";

View file

@ -2,7 +2,7 @@
, glib_networking, gst_plugins_good, gst_plugins_base, gst_plugins_ugly
}:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "mopidy-${version}";
version = "1.1.2";

View file

@ -1,10 +1,10 @@
{ stdenv, buildPythonPackage, fetchurl, gettext
{ stdenv, buildPythonApplication, fetchurl, gettext
, pkgconfig, libofa, ffmpeg, chromaprint
, pyqt4, mutagen, python-libdiscid
}:
let version = "1.3.2"; in
buildPythonPackage {
buildPythonApplication {
name = "picard-${version}";
namePrefix = "";

View file

@ -1,7 +1,7 @@
{ fetchFromGitHub, stdenv, pythonPackages, gtk3, gobjectIntrospection, libnotify
, gst_all_1, wrapGAppsHook }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
pname = "pithos";
version = "1.1.2";
name = "${pname}-${version}";

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject, intltool
{ stdenv, fetchurl, python, buildPythonApplication, mutagen, pygtk, pygobject, intltool
, pythonDBus, gst_python, withGstPlugins ? false, gst_plugins_base ? null
, gst_plugins_good ? null, gst_plugins_ugly ? null, gst_plugins_bad ? null }:
@ -9,7 +9,7 @@ assert withGstPlugins -> gst_plugins_base != null
let version = "2.6.3"; in
buildPythonPackage {
buildPythonApplication {
# call the package quodlibet and just quodlibet
name = "quodlibet-${version}"
+ stdenv.lib.optionalString withGstPlugins "-with-gst-plugins";

View file

@ -1,11 +1,11 @@
{ pkgs, stdenv, fetchFromGitHub, pkgconfig, intltool, wrapGAppsHook,
python, buildPythonPackage, isPy3k,
python, buildPythonApplication, isPy3k,
gnome3, gtk3, gobjectIntrospection,
dbus, pygobject3, mpd2 }:
with pkgs.lib;
buildPythonPackage rec {
buildPythonApplication rec {
name = "sonata-${version}";
version = "1.7b1";
namePrefix = "";

View file

@ -233,6 +233,8 @@ rec {
srcs = [ srcFeature srcPlugin1 srcPlugin2 ];
propagatedBuildInputs = [ zest ];
phases = [ "installPhase" ];
installPhase = ''
@ -240,7 +242,8 @@ rec {
mkdir -p $dropinDir/features
unzip ${srcFeature} -d $dropinDir/features/
mkdir -p $dropinDir/plugins
cp -v ${srcPlugin1} ${srcPlugin2} $dropinDir/plugins/
cp -v ${srcPlugin1} $dropinDir/plugins/''${srcPlugin1#*-}
cp -v ${srcPlugin2} $dropinDir/plugins/''${srcPlugin2#*-}
'';
meta = with stdenv.lib; {
@ -395,4 +398,21 @@ rec {
};
};
zest = buildEclipseUpdateSite rec {
name = "zest-${version}";
version = "3.9.101";
src = fetchurl {
url = "http://archive.eclipse.org/tools/gef/downloads/drops/${version}/R201408150207/GEF-${name}.zip";
sha256 = "01scn7cmcrjcp387spjm8ifgwrwwi77ypildandbisfvhj3qqs7m";
};
meta = with stdenv.lib; {
homepage = https://www.eclipse.org/gef/zest/;
description = "The Eclipse Visualization Toolkit";
platforms = platforms.all;
maintainers = [ maintainers.romildo ];
};
};
}

View file

@ -1,10 +1,11 @@
{ stdenv, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
{ stdenv, lib, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
, pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
, libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
, alsaLib, cairo, acl, gpm, AppKit, CoreWLAN, Kerberos, GSS, ImageIO
, withX ? !stdenv.isDarwin
, withGTK3 ? false, gtk3 ? null
, withGTK2 ? true, gtk2
, enableTTYTrueColor ? false
}:
assert (libXft != null) -> libpng != null; # probably a bug
@ -31,8 +32,14 @@ stdenv.mkDerivation rec {
sha256 = "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx";
};
patches = stdenv.lib.optionals stdenv.isDarwin [
patches = lib.optionals stdenv.isDarwin [
./at-fdcwd.patch
] ++ lib.optionals enableTTYTrueColor [
# Modified TTY True Color patch from: https://gist.github.com/choppsv1/36aacdd696d505566088
# To use, pass --color=true-color, which will default to using ';'
# as the separator.
# Alternatively, set $EMACS_TRUE_COLOR_SEPARATOR to ';' or ':'.
./tty-true-color.patch
];
postPatch = ''
@ -79,9 +86,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ chaoflow lovek323 simons the-kenny jwiegley ];
platforms = platforms.all;
# So that Exuberant ctags is preferred
priority = 1;
longDescription = ''
GNU Emacs is an extensible, customizable text editorand more. At its
core is an interpreter for Emacs Lisp, a dialect of the Lisp

View file

@ -0,0 +1,428 @@
diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el
index 98108ce..21814a9 100644
--- a/lisp/term/tty-colors.el
+++ b/lisp/term/tty-colors.el
@@ -764,7 +764,8 @@
(auto . 0)
(ansi8 . 8)
(always . 8)
- (yes . 8))
+ (yes . 8)
+ (true-color . 16777216))
"An alist of supported standard tty color modes and their aliases.")
(defun tty-color-alist (&optional _frame)
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index c673749..244cf7f 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -674,6 +674,15 @@ versions of xterm."
;; are more colors to support, compute them now.
(when (> ncolors 0)
(cond
+ ((= (display-color-cells (selected-frame)) 16777216) ; 24-bit xterm
+ (let ((idx (length xterm-standard-colors)))
+ ;; Insert standard X colors after the standard xterm ones
+ (mapc (lambda (color)
+ (if (not (assoc (car color) xterm-standard-colors))
+ (progn
+ (tty-color-define (car color) idx (cdr color))
+ (setq idx (1+ idx)))))
+ color-name-rgb-alist)))
((= ncolors 240) ; 256-color xterm
;; 216 non-gray colors first
(let ((r 0) (g 0) (b 0))
diff --git a/src/dispextern.h b/src/dispextern.h
index 239c442..5760b84 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1739,9 +1739,15 @@ struct face
INLINE bool
face_tty_specified_color (unsigned long color)
{
- return color < FACE_TTY_DEFAULT_BG_COLOR;
+ return (color < FACE_TTY_DEFAULT_BG_COLOR);
}
+INLINE bool
+face_tty_specified_24_bit_color (unsigned long color)
+{
+ /* 24 bit colors have 24th but not 25th bit set */
+ return ((color & (0x03 << 24)) == (0x01 << 24));
+}
/* Non-zero if FACE was realized for unibyte use. */
#define FACE_UNIBYTE_P(FACE) ((FACE)->charset < 0)
diff --git a/src/term.c b/src/term.c
index 8312491..b14aded 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1915,18 +1915,40 @@ turn_on_face (struct frame *f, int face_id)
const char *ts;
char *p;
- ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
+ if (face_tty_specified_24_bit_color(fg))
+ ts = tty->standout_mode ? tty->TS_set_rgb_background : tty->TS_set_rgb_foreground;
+ else
+ ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
if (face_tty_specified_color (fg) && ts)
{
- p = tparam (ts, NULL, 0, fg, 0, 0, 0);
+ if (!face_tty_specified_24_bit_color(fg))
+ p = tparam (ts, NULL, 0, fg, 0, 0, 0);
+ else
+ {
+ const unsigned char r = (fg >> 16) & 0xFF,
+ g = (fg >> 8) & 0xFF,
+ b = fg & 0xFF;
+ p = tparam (ts, NULL, 0, (int)r, (int)g, (int)b, 0);
+ }
OUTPUT (tty, p);
xfree (p);
}
- ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
+ if (face_tty_specified_24_bit_color(bg))
+ ts = tty->standout_mode ? tty->TS_set_rgb_foreground : tty->TS_set_rgb_background;
+ else
+ ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
if (face_tty_specified_color (bg) && ts)
{
- p = tparam (ts, NULL, 0, bg, 0, 0, 0);
+ if (!face_tty_specified_24_bit_color(bg))
+ p = tparam (ts, NULL, 0, bg, 0, 0, 0);
+ else
+ {
+ const unsigned char r = (bg >> 16) & 0xFF,
+ g = (bg >> 8) & 0xFF,
+ b = bg & 0xFF;
+ p = tparam (ts, NULL, 0, (int)r, (int)g, (int)b, 0);
+ }
OUTPUT (tty, p);
xfree (p);
}
@@ -2028,6 +2050,8 @@ TERMINAL does not refer to a text terminal. */)
struct terminal *t = get_tty_terminal (terminal, 0);
if (!t)
return make_number (0);
+ else if (t->display_info.tty->TS_set_rgb_foreground)
+ return make_number (16777216); /* 24 bit True Color */
else
return make_number (t->display_info.tty->TN_max_colors);
}
@@ -2043,6 +2067,8 @@ static int default_no_color_video;
static char *default_orig_pair;
static char *default_set_foreground;
static char *default_set_background;
+static char *default_set_rgb_foreground;
+static char *default_set_rgb_background;
/* Save or restore the default color-related capabilities of this
terminal. */
@@ -2055,6 +2081,8 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save)
dupstring (&default_orig_pair, tty->TS_orig_pair);
dupstring (&default_set_foreground, tty->TS_set_foreground);
dupstring (&default_set_background, tty->TS_set_background);
+ dupstring (&default_set_rgb_foreground, tty->TS_set_rgb_foreground);
+ dupstring (&default_set_rgb_background, tty->TS_set_rgb_background);
default_max_colors = tty->TN_max_colors;
default_max_pairs = tty->TN_max_pairs;
default_no_color_video = tty->TN_no_color_video;
@@ -2064,6 +2092,8 @@ tty_default_color_capabilities (struct tty_display_info *tty, bool save)
tty->TS_orig_pair = default_orig_pair;
tty->TS_set_foreground = default_set_foreground;
tty->TS_set_background = default_set_background;
+ tty->TS_set_rgb_foreground = default_set_rgb_foreground;
+ tty->TS_set_rgb_background = default_set_rgb_background;
tty->TN_max_colors = default_max_colors;
tty->TN_max_pairs = default_max_pairs;
tty->TN_no_color_video = default_no_color_video;
@@ -2088,6 +2118,7 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
tty->TN_max_pairs = 0;
tty->TN_no_color_video = 0;
tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL;
+ tty->TS_set_rgb_foreground = tty->TS_set_rgb_background = NULL;
break;
case 0: /* default colors, if any */
default:
@@ -2102,10 +2133,45 @@ tty_setup_colors (struct tty_display_info *tty, int mode)
tty->TS_set_foreground = "\033[3%dm";
tty->TS_set_background = "\033[4%dm";
#endif
+ tty->TS_set_rgb_foreground = NULL;
+ tty->TS_set_rgb_background = NULL;
tty->TN_max_colors = 8;
tty->TN_max_pairs = 64;
tty->TN_no_color_video = 0;
break;
+ case 16777216: /* RGB colors */
+ tty->TS_orig_pair = "\033[0m";
+
+ /* if the user hasn't explicitly chosen the ":" separator, use ";". */
+ char * true_color_separator = getenv ("EMACS_TRUE_COLOR_SEPARATOR");
+ if (true_color_separator && strcmp (true_color_separator, ":") == 0)
+ {
+ /* XXX chopps use ITU T.421 ':' separator */
+ /* TODO This should be extracted from terminfo/termcap. */
+#ifdef TERMINFO
+ tty->TS_set_rgb_foreground = "\033[38:2:%p1%d:%p2%d:%p3%dm";
+ tty->TS_set_rgb_background = "\033[48:2:%p1%d:%p2%d:%p3%dm";
+#else
+ tty->TS_set_rgb_foreground = "\033[38:2:%d:%d:%dm";
+ tty->TS_set_rgb_background = "\033[48:2:%d:%d:%dm";
+#endif
+ }
+ else
+ {
+ /* TODO This should be extracted from terminfo/termcap. */
+#ifdef TERMINFO
+ tty->TS_set_rgb_foreground = "\033[38;2;%p1%d;%p2%d;%p3%dm";
+ tty->TS_set_rgb_background = "\033[48;2;%p1%d;%p2%d;%p3%dm";
+#else
+ tty->TS_set_rgb_foreground = "\033[38;2;%d;%d;%dm";
+ tty->TS_set_rgb_background = "\033[48;2;%d;%d;%dm";
+#endif
+ }
+
+ tty->TN_max_colors = 16777216;
+ /*tty->TN_max_pairs = 64; TODO */
+ tty->TN_no_color_video = 0;
+ break;
}
}
@@ -4201,6 +4267,38 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
tty->TN_no_color_video = tgetnum ("NC");
if (tty->TN_no_color_video == -1)
tty->TN_no_color_video = 0;
+
+
+ /* Allow the user to opt-in to True Color support. */
+ char * true_color_separator = getenv ("EMACS_TRUE_COLOR_SEPARATOR");
+ if (true_color_separator && strcmp (true_color_separator, ";") == 0)
+ {
+ /* TODO This should be extracted from terminfo/termcap. */
+#ifdef TERMINFO
+ tty->TS_set_rgb_foreground = "\033[38;2;%p1%d;%p2%d;%p3%dm";
+ tty->TS_set_rgb_background = "\033[48;2;%p1%d;%p2%d;%p3%dm";
+#else
+ tty->TS_set_rgb_foreground = "\033[38;2;%d;%d;%dm";
+ tty->TS_set_rgb_background = "\033[48;2;%d;%d;%dm";
+#endif
+ }
+ else if (true_color_separator && strcmp (true_color_separator, ":") == 0)
+ {
+ /* XXX chopps use ITU T.421 ':' separator */
+ /* TODO This should be extracted from terminfo/termcap. */
+#ifdef TERMINFO
+ tty->TS_set_rgb_foreground = "\033[38:2:%p1%d:%p2%d:%p3%dm";
+ tty->TS_set_rgb_background = "\033[48:2:%p1%d:%p2%d:%p3%dm";
+#else
+ tty->TS_set_rgb_foreground = "\033[38:2:%d:%d:%dm";
+ tty->TS_set_rgb_background = "\033[48:2:%d:%d:%dm";
+#endif
+ }
+ else
+ {
+ tty->TS_set_rgb_foreground = NULL;
+ tty->TS_set_rgb_background = NULL;
+ }
}
tty_default_color_capabilities (tty, 1);
diff --git a/src/termchar.h b/src/termchar.h
index d8066d7..e48d583 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -157,6 +157,10 @@ struct tty_display_info
const char *TS_set_foreground;
const char *TS_set_background;
+ /* Support for 24bit RGB color terminals. */
+ const char *TS_set_rgb_foreground;
+ const char *TS_set_rgb_background;
+
int TF_hazeltine; /* termcap hz flag. */
int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
int TF_standout_motion; /* termcap mi flag: can move while in standout mode. */
diff --git a/src/xfaces.c b/src/xfaces.c
index 29c91f7..347ebf8 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -382,7 +382,7 @@ static ptrdiff_t lface_id_to_name_size;
/* TTY color-related functions (defined in tty-colors.el). */
-static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values;
+static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values, Qtty_color_canonicalize;
/* The name of the function used to compute colors on TTYs. */
@@ -943,54 +943,80 @@ tty_lookup_color (struct frame *f, Lisp_Object color, XColor *tty_color,
if (!STRINGP (color) || NILP (Ffboundp (Qtty_color_desc)))
return 0;
- XSETFRAME (frame, f);
-
- color_desc = call2 (Qtty_color_desc, color, frame);
- if (CONSP (color_desc) && CONSP (XCDR (color_desc)))
+ if (f->output_method == output_termcap
+ && f->output_data.tty->display_info->TS_set_rgb_foreground
+ && !NILP (Ffboundp (Qtty_color_standard_values)))
{
- Lisp_Object rgb;
-
- if (! INTEGERP (XCAR (XCDR (color_desc))))
- return 0;
+ /* Terminal supports 3 byte RGB colors. */
+ if (!NILP (Ffboundp (Qtty_color_canonicalize)))
+ color = call1(Qtty_color_canonicalize, color);
- tty_color->pixel = XINT (XCAR (XCDR (color_desc)));
+ color_desc = call1 (Qtty_color_standard_values, color);
+ if (! parse_rgb_list (color_desc, tty_color))
+ return 0;
- rgb = XCDR (XCDR (color_desc));
- if (! parse_rgb_list (rgb, tty_color))
- return 0;
+ /* Map XColor to 3 byte values. */
+ tty_color->pixel = 1 << 24 /* Set bit 24 to mark RGB values. */
+ | (tty_color->red / 256) << 16
+ | (tty_color->green / 256) << 8
+ | (tty_color->blue / 256);
- /* Should we fill in STD_COLOR too? */
if (std_color)
- {
- /* Default STD_COLOR to the same as TTY_COLOR. */
- *std_color = *tty_color;
-
- /* Do a quick check to see if the returned descriptor is
- actually _exactly_ equal to COLOR, otherwise we have to
- lookup STD_COLOR separately. If it's impossible to lookup
- a standard color, we just give up and use TTY_COLOR. */
- if ((!STRINGP (XCAR (color_desc))
- || NILP (Fstring_equal (color, XCAR (color_desc))))
- && !NILP (Ffboundp (Qtty_color_standard_values)))
- {
- /* Look up STD_COLOR separately. */
- rgb = call1 (Qtty_color_standard_values, color);
- if (! parse_rgb_list (rgb, std_color))
- return 0;
- }
- }
+ *std_color = *tty_color;
return 1;
}
- else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist"))))
- /* We were called early during startup, and the colors are not
- yet set up in tty-defined-color-alist. Don't return a failure
- indication, since this produces the annoying "Unable to
- load color" messages in the *Messages* buffer. */
- return 1;
else
- /* tty-color-desc seems to have returned a bad value. */
- return 0;
+ {
+ XSETFRAME (frame, f);
+
+ color_desc = call2 (Qtty_color_desc, color, frame);
+ if (CONSP (color_desc) && CONSP (XCDR (color_desc)))
+ {
+ Lisp_Object rgb;
+
+ if (! INTEGERP (XCAR (XCDR (color_desc))))
+ return 0;
+
+ tty_color->pixel = XINT (XCAR (XCDR (color_desc)));
+
+ rgb = XCDR (XCDR (color_desc));
+ if (! parse_rgb_list (rgb, tty_color))
+ return 0;
+
+ /* Should we fill in STD_COLOR too? */
+ if (std_color)
+ {
+ /* Default STD_COLOR to the same as TTY_COLOR. */
+ *std_color = *tty_color;
+
+ /* Do a quick check to see if the returned descriptor is
+ actually _exactly_ equal to COLOR, otherwise we have to
+ lookup STD_COLOR separately. If it's impossible to lookup
+ a standard color, we just give up and use TTY_COLOR. */
+ if ((!STRINGP (XCAR (color_desc))
+ || NILP (Fstring_equal (color, XCAR (color_desc))))
+ && !NILP (Ffboundp (Qtty_color_standard_values)))
+ {
+ /* Look up STD_COLOR separately. */
+ rgb = call1 (Qtty_color_standard_values, color);
+ if (! parse_rgb_list (rgb, std_color))
+ return 0;
+ }
+ }
+
+ return 1;
+ }
+ else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist"))))
+ /* We were called early during startup, and the colors are not
+ yet set up in tty-defined-color-alist. Don't return a failure
+ indication, since this produces the annoying "Unable to
+ load color" messages in the *Messages* buffer. */
+ return 1;
+ else
+ /* tty-color-desc seems to have returned a bad value. */
+ return 0;
+ }
}
/* A version of defined_color for non-X frames. */
@@ -1008,7 +1034,9 @@ tty_defined_color (struct frame *f, const char *color_name,
color_def->green = 0;
if (*color_name)
- status = tty_lookup_color (f, build_string (color_name), color_def, NULL);
+ {
+ status = tty_lookup_color (f, build_string (color_name), color_def, NULL);
+ }
if (color_def->pixel == FACE_TTY_DEFAULT_COLOR && *color_name)
{
@@ -5780,6 +5808,7 @@ map_tty_color (struct frame *f, struct face *face,
unsigned long default_pixel =
foreground_p ? FACE_TTY_DEFAULT_FG_COLOR : FACE_TTY_DEFAULT_BG_COLOR;
unsigned long pixel = default_pixel;
+ XColor true_color;
#ifdef MSDOS
unsigned long default_other_pixel =
foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR;
@@ -5798,7 +5827,18 @@ map_tty_color (struct frame *f, struct face *face,
{
/* Associations in tty-defined-color-alist are of the form
(NAME INDEX R G B). We need the INDEX part. */
- pixel = XINT (XCAR (XCDR (def)));
+ if (f->output_method == output_termcap
+ && f->output_data.tty->display_info->TS_set_rgb_foreground
+ && parse_rgb_list (XCDR (XCDR(def)), &true_color))
+ {
+ /* Map XColor to 3 byte values. */
+ pixel = 1 << 24 /* Set bit 24 to mark RGB values. */
+ | (true_color.red / 256) << 16
+ | (true_color.green / 256) << 8
+ | (true_color.blue / 256);
+ }
+ else
+ pixel = XINT (XCAR (XCDR (def)));
}
if (pixel == default_pixel && STRINGP (color))
@@ -6460,6 +6500,7 @@ syms_of_xfaces (void)
DEFSYM (Qwindow_divider, "window-divider");
DEFSYM (Qwindow_divider_first_pixel, "window-divider-first-pixel");
DEFSYM (Qwindow_divider_last_pixel, "window-divider-last-pixel");
+ DEFSYM (Qtty_color_canonicalize, "tty-color-canonicalize");
DEFSYM (Qtty_color_desc, "tty-color-desc");
DEFSYM (Qtty_color_standard_values, "tty-color-standard-values");
DEFSYM (Qtty_color_by_index, "tty-color-by-index");

View file

@ -81,10 +81,10 @@
aggressive-indent = callPackage ({ cl-lib ? null, elpaBuild, emacs, fetchurl, lib }:
elpaBuild {
pname = "aggressive-indent";
version = "1.4";
version = "1.5";
src = fetchurl {
url = "http://elpa.gnu.org/packages/aggressive-indent-1.4.el";
sha256 = "0qdpvdzmw4hq2g8krx93fbb352nkg731p7v82zhqw76y79khdpka";
url = "http://elpa.gnu.org/packages/aggressive-indent-1.5.el";
sha256 = "00ddfni659rl19ybzrywj3b444akvil6n06k8lf5jyaqb53mkc5d";
};
packageRequires = [ cl-lib emacs ];
meta = {
@ -95,10 +95,10 @@
ahungry-theme = callPackage ({ elpaBuild, emacs, fetchurl, lib }:
elpaBuild {
pname = "ahungry-theme";
version = "1.0.12";
version = "1.1.0";
src = fetchurl {
url = "http://elpa.gnu.org/packages/ahungry-theme-1.0.12.tar";
sha256 = "0a6mlxka1b7vja4wxd8gvfhfk5i1jdj3a851c7dn34hz1lkgvnx8";
url = "http://elpa.gnu.org/packages/ahungry-theme-1.1.0.tar";
sha256 = "1jy2h4r72fr26yavs0s8dy1xnkxvaf2hsrlm63f6sng81njj9dgx";
};
packageRequires = [ emacs ];
meta = {
@ -119,6 +119,19 @@
license = lib.licenses.free;
};
}) {};
ampc = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "ampc";
version = "0.2";
src = fetchurl {
url = "http://elpa.gnu.org/packages/ampc-0.2.el";
sha256 = "1pdy5mvi6h8m7qjnxiy217fgcp9w91375hq29bacfgh7bix56jlr";
};
packageRequires = [];
meta = {
homepage = "http://elpa.gnu.org/packages/ampc.html";
license = lib.licenses.free;
};
}) {};
ascii-art-to-unicode = callPackage ({ elpaBuild, fetchurl, lib }:
elpaBuild {
pname = "ascii-art-to-unicode";
@ -201,10 +214,10 @@
}) {};
beacon = callPackage ({ elpaBuild, fetchurl, lib, seq }: elpaBuild {
pname = "beacon";
version = "0.6.1";
version = "1.0";
src = fetchurl {
url = "http://elpa.gnu.org/packages/beacon-0.6.1.el";
sha256 = "0zg3gzfx06f3pj7mipfdmhmafvcil0idha3wdi068cza7akmyiwb";
url = "http://elpa.gnu.org/packages/beacon-1.0.el";
sha256 = "1rdvdn50kb7kplvi8x199cm15mn4pxidn17p84l8q5wk3arj9c09";
};
packageRequires = [ seq ];
meta = {
@ -215,10 +228,10 @@
bug-hunter = callPackage ({ cl-lib ? null, elpaBuild, fetchurl, lib, seq }:
elpaBuild {
pname = "bug-hunter";
version = "1.0.1";
version = "1.1";
src = fetchurl {
url = "http://elpa.gnu.org/packages/bug-hunter-1.0.1.el";
sha256 = "0c0pg542y09c1k25dxk2062pj3cj12i73kqxbpq0m6af0qm7wy9d";
url = "http://elpa.gnu.org/packages/bug-hunter-1.1.el";
sha256 = "07j455hizqiicpigy8ybpqk0v87iqa57jvpirg5yb2g8j5ipwygs";
};
packageRequires = [ cl-lib seq ];
meta = {
@ -617,10 +630,10 @@
}) {};
exwm = callPackage ({ elpaBuild, fetchurl, lib, xelb }: elpaBuild {
pname = "exwm";
version = "0.1";
version = "0.2";
src = fetchurl {
url = "http://elpa.gnu.org/packages/exwm-0.1.tar";
sha256 = "18w9a37v8lyyjj8ll2f5mw8fw14g54b887cflzv5d576k5f606f5";
url = "http://elpa.gnu.org/packages/exwm-0.2.tar";
sha256 = "0z96zz6h5r880nbhclbxs2r0zfkg771lg0fjghigqxz8ai0hh1ll";
};
packageRequires = [ xelb ];
meta = {
@ -1044,10 +1057,10 @@
}) {};
multishell = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "multishell";
version = "1.1.2";
version = "1.1.5";
src = fetchurl {
url = "http://elpa.gnu.org/packages/multishell-1.1.2.tar";
sha256 = "1y0b6ri0kgxj0jw1cyb796lsy3ipzb7syvmj7pqpx9myzpvd3hz3";
url = "http://elpa.gnu.org/packages/multishell-1.1.5.tar";
sha256 = "0g38p5biyxqkjdkmxlikvhkhkmafyy3ibd012q83skaf8fi4cv1y";
};
packageRequires = [];
meta = {
@ -1202,10 +1215,10 @@
}) {};
org = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "org";
version = "20160201";
version = "20160215";
src = fetchurl {
url = "http://elpa.gnu.org/packages/org-20160201.tar";
sha256 = "1lyvfpksl88c9d7k2w4k3iswgjah51k9f8fdi3jbfwivd814m9nb";
url = "http://elpa.gnu.org/packages/org-20160215.tar";
sha256 = "0w2686rza4xdknq3sy87s04zvlmjxyr6wrj9y9ydcv8hbzws3bhd";
};
packageRequires = [];
meta = {
@ -1492,10 +1505,10 @@
}) {};
spinner = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "spinner";
version = "1.4";
version = "1.7";
src = fetchurl {
url = "http://elpa.gnu.org/packages/spinner-1.4.el";
sha256 = "0j4x8hbnhda83yyb31mm9b014pfb81gdfsr026rhn8ls3y163dbf";
url = "http://elpa.gnu.org/packages/spinner-1.7.el";
sha256 = "1y78kr26mi74xf0qh32dvhk7w3bkj6d9i2iw1mypsr0h5phg8ahf";
};
packageRequires = [];
meta = {
@ -1532,10 +1545,10 @@
svg-clock = callPackage ({ elpaBuild, emacs, fetchurl, lib, svg }:
elpaBuild {
pname = "svg-clock";
version = "0.5";
version = "1.0";
src = fetchurl {
url = "http://elpa.gnu.org/packages/svg-clock-0.5.el";
sha256 = "1i77c7nyqcwc6b6n7vdh95xbmwv5kpdds6j7pklp4c9vbvm8axgp";
url = "http://elpa.gnu.org/packages/svg-clock-1.0.el";
sha256 = "0j6zk7fsv72af12phqdw8axbn2y8y4rfgxiab1p3pxq3y7k47jid";
};
packageRequires = [ emacs svg ];
meta = {
@ -1623,6 +1636,19 @@
license = lib.licenses.free;
};
}) {};
tramp-theme = callPackage ({ elpaBuild, emacs, fetchurl, lib }: elpaBuild {
pname = "tramp-theme";
version = "0.1.1";
src = fetchurl {
url = "http://elpa.gnu.org/packages/tramp-theme-0.1.1.el";
sha256 = "0l8i625h9sc6h59qfj847blmfwfhf9bvfsbmwfb56qzs535fby3y";
};
packageRequires = [ emacs ];
meta = {
homepage = "http://elpa.gnu.org/packages/tramp-theme.html";
license = lib.licenses.free;
};
}) {};
transcribe = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "transcribe";
version = "1.0.2";
@ -1675,6 +1701,20 @@
license = lib.licenses.free;
};
}) {};
url-http-ntlm = callPackage ({ cl-lib ? null, elpaBuild, fetchurl, lib, ntlm ? null }:
elpaBuild {
pname = "url-http-ntlm";
version = "2.0.1";
src = fetchurl {
url = "http://elpa.gnu.org/packages/url-http-ntlm-2.0.1.tar";
sha256 = "0h6xsm1x7v69kb4shyvv1p4f6sxgcqs5ap6ylqydz10mbcx7aq0w";
};
packageRequires = [ cl-lib ntlm ];
meta = {
homepage = "http://elpa.gnu.org/packages/url-http-ntlm.html";
license = lib.licenses.free;
};
}) {};
vlf = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
pname = "vlf";
version = "1.7";
@ -1809,10 +1849,10 @@
xelb = callPackage ({ cl-generic, elpaBuild, emacs, fetchurl, lib }:
elpaBuild {
pname = "xelb";
version = "0.4";
version = "0.5";
src = fetchurl {
url = "http://elpa.gnu.org/packages/xelb-0.4.tar";
sha256 = "1m3wmlzcnbv1akncdaakfy4xmxyjnfb6yl1nfahwf4lfxlsvnwzd";
url = "http://elpa.gnu.org/packages/xelb-0.5.tar";
sha256 = "1wypffg492r2a3h136c6mphsbgimxcipsarm971z56kpy3lwi4sb";
};
packageRequires = [ cl-generic emacs ];
meta = {

File diff suppressed because it is too large Load diff

View file

@ -148,14 +148,14 @@ in
android-studio = buildAndroidStudio rec {
name = "android-studio-${version}";
version = "1.5.1.0";
build = "141.2456560";
version = "2.0.0.0";
build = "143.2443734";
description = "Android development environment based on IntelliJ IDEA";
license = stdenv.lib.licenses.asl20;
src = fetchurl {
url = "https://dl.google.com/dl/android/studio/ide-zips/${version}" +
"/android-studio-ide-${build}-linux.zip";
sha256 = "0p6h21jd0xx3xzdrfv9530n1ssyc3xigr3fg33r8ain4k6n02vj6";
sha256 = "0j6bi87hb5jxjwfhfya64s673vdkdslsqc6sqa4zl97sabvafk2w";
};
};
@ -185,25 +185,25 @@ in
idea-community = buildIdea rec {
name = "idea-community-${version}";
version = "15.0.3";
build = "IC-143.1821";
version = "15.0.4";
build = "IC-143.2287";
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 = "15hj4kqlpg3b4xp2v4f4iidascrc8s97mq8022nvbcs879gpajqa";
sha256 = "05kah5cx7x3rlaaxkvbbm7g8jvy9hc38q4jv7j5r9rkxd38fslvn";
};
};
idea-ultimate = buildIdea rec {
name = "idea-ultimate-${version}";
version = "15.0.3";
build = "IU-143.1821";
version = "15.0.4";
build = "IU-143.2287";
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 = "02v8v2a7p620l4mlk7jqw9sl2455a1nya1dy84y23h9vq20aihlh";
sha256 = "0416y7krrak1q5pb8axskdamy06nfxmn4hj7421j8jaz0nc50dn4";
};
};

View file

@ -21,12 +21,12 @@
stdenv.mkDerivation rec {
name = "kile-${version}";
version = "2016-02-12";
version = "2016-02-14";
src = fetchgit {
url = git://anongit.kde.org/kile.git;
rev = "c586532031872319ae5102fb13ab6de8d80da065";
sha256 = "7d5ef8b8c1254a5988a1028e415c9139fbd20a9e6771413c38fa58345a744a7b";
rev = "7b238c42580abc936816d4ea0df61d0cbbefecc4";
sha256 = "f37d531489a84911b47664697bb3bddc0ba5591854749c17fb0c6b1e71dbc6ee";
};

View file

@ -1,6 +1,6 @@
{ stdenv, pythonPackages, fetchgit }:
pythonPackages.buildPythonPackage rec {
pythonPackages.buildPythonApplication rec {
name = "leo-editor-${version}";
namePrefix = "";
version = "5.1";

View file

@ -1,6 +1,6 @@
{ pkgs, fetchurl, tk, buildPythonPackage, pythonPackages }:
{ pkgs, fetchurl, tk, buildPythonApplication, pythonPackages }:
buildPythonPackage rec {
buildPythonApplication rec {
version = "0.9.2";
name = "nvpy-${version}";

View file

@ -1,5 +1,10 @@
{ stdenv, fetchFromGitHub, ncurses, gettext, pkgconfig
{ stdenv, fetchFromGitHub, fetchurl, ncurses, gettext, pkgconfig
# default vimrc
, vimrc ? fetchurl {
name = "default-vimrc";
url = https://projects.archlinux.org/svntogit/packages.git/plain/trunk/archlinux.vim?h=packages/vim?id=68f6d131750aa778807119e03eed70286a17b1cb;
sha256 = "18ifhv5q9prd175q3vxbqf6qyvkk6bc7d2lhqdk0q78i68kv9y0c";
}
# apple frameworks
, Carbon, Cocoa }:
@ -25,7 +30,11 @@ stdenv.mkDerivation rec {
"--enable-nls"
];
postInstall = "ln -s $out/bin/vim $out/bin/vi";
postInstall = ''
ln -s $out/bin/vim $out/bin/vi
mkdir -p $out/share/vim
cp "${vimrc}" $out/share/vim/vimrc
'';
crossAttrs = {
configureFlags = [

View file

@ -6,6 +6,12 @@
stdenv.mkDerivation rec {
name = "gimp-2.8.16";
# This declarations for `gimp-with-plugins` wrapper,
# (used for determining $out/lib/gimp/${majorVersion}/ paths)
majorVersion = "2.0";
targetPluginDir = "$out/lib/gimp/${majorVersion}/plug-ins";
targetScriptDir = "$out/lib/gimp/${majorVersion}/scripts";
src = fetchurl {
url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
sha256 = "1dsgazia9hmab8cw3iis7s69dvqyfj5wga7ds7w2q5mms1xqbqwm";

View file

@ -6,9 +6,7 @@
{ pkgs, gimp }:
let
inherit (pkgs) stdenv fetchurl pkgconfig glib;
targetPluginDir = "$out/${gimp.name}-plugins";
targetScriptDir = "$out/${gimp.name}-scripts";
prefix = "plugin-gimp-";
inherit (gimp) targetPluginDir targetScriptDir;
pluginDerivation = a: stdenv.mkDerivation ({
prePhases = "extraLib";
@ -52,7 +50,7 @@ rec {
name = "gap-2.6.0";
buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.nativeBuildInputs;
src = fetchurl {
url = ftp://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
url = http://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
};
patchPhase = ''

View file

@ -0,0 +1,33 @@
{ stdenv, lib, buildEnv, gimp, makeWrapper, gimpPlugins, plugins ? null}:
let
allPlugins = lib.filter (pkg: builtins.isAttrs pkg && pkg.type == "derivation") (lib.attrValues gimpPlugins);
selectedPlugins = if plugins == null then allPlugins else plugins;
extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
drv = buildEnv {
name = "gimp-with-plugins-" + (builtins.parseDrvName gimp.name).version;
paths = [ gimp ] ++ selectedPlugins;
postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
if [ -L $out/bin ]; then
rm $out/bin
mkdir $out/bin
for i in ${gimp}/bin/*; do
ln -s $i $out/bin
done
fi
for each in gimp-2.8 gimp-console-2.8; do
wrapProgram $out/bin/$each \
--set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
${toString extraArgs}
done
set +x
for each in gimp gimp-console; do
ln -sf "$each-2.8" $out/bin/$each
done
'';
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })

View file

@ -1,23 +1,25 @@
{ stdenv, cmake, fetchurl, gnumake, pkgconfig
{ stdenv, cmake, fetchurl, gnumake, pkgconfig, makeWrapper
, boost, gettext, tclap, wxGTK
, freeglut, glew, libXi, libXmu, mesa
, autopanosiftc, enblend-enfuse, exiv2, ilmbase, lensfun, libpng, libtiff
, openexr, panotools, perlPackages
, autopanosiftc, enblend-enfuse, exiv2, fftw, ilmbase, lensfun, libpng, libtiff
, openexr, panotools, perlPackages, sqlite, vigra
}:
stdenv.mkDerivation rec {
name = "hugin-2013.0.0";
name = "hugin-2015.0.0";
src = fetchurl {
url = "mirror://sourceforge/hugin/${name}.tar.bz2";
sha256 = "1mgbvg09xvf0zcm9jfv5lb65nd292l86ffa23yp4pzm6izaiwkj8";
sha256 = "1gfblax9rxay8xskz5r8bips4nfh70vkyrb8ksgl6pg91c8krn9c";
};
NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
buildInputs = [ boost gettext tclap wxGTK
freeglut glew libXi libXmu mesa
exiv2 ilmbase lensfun libtiff libpng openexr panotools
exiv2 fftw ilmbase lensfun libtiff libpng openexr panotools
sqlite vigra
perlPackages.ImageExifTool makeWrapper
];
# disable installation of the python scripting interface
@ -27,22 +29,21 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
# commandline tools needed by the hugin batch processor
# you may have to tell hugin (in the preferences) where these binaries reside
propagatedUserEnvPackages = [ autopanosiftc enblend-enfuse gnumake
perlPackages.ImageExifTool
];
postInstall = ''
mkdir -p "$out/nix-support"
echo $propagatedUserEnvPackages > $out/nix-support/propagated-user-env-packages
for p in $out/bin/*; do
wrapProgram "$p" \
--suffix PATH : ${autopanosiftc}/bin \
--suffix PATH : ${enblend-enfuse}/bin \
--suffix PATH : ${gnumake}/bin \
--suffix PATH : ${perlPackages.ImageExifTool}/bin
done
'';
meta = {
homepage = http://hugin.sourceforge.net/;
description = "Toolkit for stitching photographs and assembling panoramas, together with an easy to use graphical front end";
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [viric];
maintainers = with stdenv.lib.maintainers; [ viric hrdinka ];
platforms = with stdenv.lib.platforms; linux;
};
}

View file

@ -1,6 +1,6 @@
{ stdenv, fetchsvn, buildPythonPackage, python, pyGtkGlade, makeWrapper, pyexiv2, pythonPackages, fbida, which }:
{ stdenv, fetchsvn, buildPythonApplication, python, pyGtkGlade, makeWrapper, pyexiv2, pythonPackages, fbida, which }:
buildPythonPackage rec {
buildPythonApplication rec {
name = "jbrout-${version}";
version = "338";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildPythonPackage, python27Packages }:
{ stdenv, fetchurl, buildPythonApplication, python27Packages }:
buildPythonPackage rec {
buildPythonApplication rec {
namePrefix = "";
name = "mcomix-1.01";

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, buildPythonPackage, python, pygtk, pillow, libX11, gettext }:
{ stdenv, fetchurl, buildPythonApplication, python, pygtk, pillow, libX11, gettext }:
buildPythonPackage rec {
buildPythonApplication rec {
namePrefix = "";
name = "mirage-0.9.5.2";

View file

@ -1,10 +1,10 @@
{ callPackage, fetchgit, ... } @ args:
callPackage ./generic.nix (args // {
version = "2016-01-25";
version = "2016-02-25";
src = fetchgit {
sha256 = "db1fecd671bd8b3a777138bb4815285b4364ee3ad01ab05424b4aa0c20ed9919";
rev = "056f590f2d147099554d97a89dd5e0ddfa8d6dda";
sha256 = "842b1186d38de14221be514a58f77c23d9f83979ea45f846440cf9cbb1f26c1f";
rev = "c5117ed0f1b522eab10fd2248f140b2acad2a708";
url = "git://alioth.debian.org/git/sane/sane-backends.git";
};
})

View file

@ -35,9 +35,11 @@ let
dolphin = callPackage ./dolphin.nix {};
dolphin-plugins = callPackage ./dolphin-plugins.nix {};
ffmpegthumbs = callPackage ./ffmpegthumbs.nix {};
filelight = callPackage ./filelight.nix {};
gpgmepp = callPackage ./gpgmepp.nix {};
gwenview = callPackage ./gwenview.nix {};
kate = callPackage ./kate.nix {};
kcalc = callPackage ./kcalc.nix {};
kdegraphics-thumbnailers = callPackage ./kdegraphics-thumbnailers.nix {};
kdenetwork-filesharing = callPackage ./kdenetwork-filesharing.nix {};
kgpg = callPackage ./kgpg.nix { inherit (pkgs.kde4) kdepimlibs; };

View file

@ -0,0 +1,35 @@
{ kdeApp
, lib
, extra-cmake-modules
, kdoctools
, makeQtWrapper
, qtscript
, kio
, solid
, kxmlgui
, kparts
}:
kdeApp {
name = "filelight";
nativeBuildInputs = [
extra-cmake-modules
kdoctools
makeQtWrapper
];
buildInputs = [
kio
kparts
qtscript
solid
kxmlgui
];
postInstall = ''
wrapQtProgram "$out/bin/filelight"
'';
meta = {
license = with lib.licenses; [ gpl2 ];
maintainers = with lib.maintainers; [ fridh vcunat ];
};
}

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