From 6f6724027d10c8989f08df9dc36b09b27152ae36 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 27 Aug 2014 15:13:54 +0800 Subject: fcitx: update to 4.2.8.4 --- pkgs/tools/inputmethods/fcitx/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/inputmethods/fcitx/default.nix b/pkgs/tools/inputmethods/fcitx/default.nix index 2795b0d4d87..2db5d36a10d 100644 --- a/pkgs/tools/inputmethods/fcitx/default.nix +++ b/pkgs/tools/inputmethods/fcitx/default.nix @@ -5,11 +5,11 @@ }: stdenv.mkDerivation rec { - name = "fcitx-4.2.8.3"; + name = "fcitx-4.2.8.4"; src = fetchurl { url = "http://download.fcitx-im.org/fcitx/${name}_dict.tar.xz"; - sha256 = "05dw6cbjh2jyjrkr4qx2bcq6nyhhrs0akf6fcjk5a72bgphhwqnb"; + sha256 = "1yhvqg4q0knywdrh8sljqjn1i72rd8ya0fr70pc0w7fq25013x37"; }; patchPhase = '' -- cgit 1.4.1 From 92f728d546bba5d2c0e87ff28dd91b4d347b66d9 Mon Sep 17 00:00:00 2001 From: 宋文武 Date: Wed, 27 Aug 2014 17:05:14 +0800 Subject: add fcitx-anthy --- pkgs/tools/inputmethods/fcitx/fcitx-anthy.nix | 24 ++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/tools/inputmethods/fcitx/fcitx-anthy.nix (limited to 'pkgs/tools') diff --git a/pkgs/tools/inputmethods/fcitx/fcitx-anthy.nix b/pkgs/tools/inputmethods/fcitx/fcitx-anthy.nix new file mode 100644 index 00000000000..2099220f2a1 --- /dev/null +++ b/pkgs/tools/inputmethods/fcitx/fcitx-anthy.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, cmake, fcitx, anthy }: + +stdenv.mkDerivation rec { + name = "fcitx-anthy-0.2.1"; + + meta = with stdenv.lib; { + description = "Fcitx Wrapper for anthy"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ iyzsong ]; + }; + + src = fetchurl { + url = "http://download.fcitx-im.org/fcitx-anthy/${name}.tar.xz"; + sha256 = "13fpfhhxkzbq53h10i3hifa37nngm47jq361i70z22bgcrs8887x"; + }; + + buildInputs = [ cmake fcitx anthy ]; + + preInstall = '' + substituteInPlace src/cmake_install.cmake \ + --replace ${fcitx} $out + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb8f6e5bdca..f5daed73c9d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1021,6 +1021,8 @@ let fcitx = callPackage ../tools/inputmethods/fcitx { }; + fcitx-anthy = callPackage ../tools/inputmethods/fcitx/fcitx-anthy.nix { }; + fcron = callPackage ../tools/system/fcron { }; fdm = callPackage ../tools/networking/fdm {}; -- cgit 1.4.1 From f6954aa8d5d2c775b4bfe5b40e6b1682bc2f9143 Mon Sep 17 00:00:00 2001 From: Emil Rangden Date: Thu, 28 Aug 2014 23:58:08 +0200 Subject: updated wkhtmltopdf and use patched qt With stock version of qt4 wkthmltopdf lacks a lot of features, including: * Running without an X11 server * Printing more then one HTML document into a PDF file * Adding a document outline to the PDF file * Adding headers and footers to the PDF file * Generating a table of contents * Adding links in the generated PDF file * Printing using the screen media-type * Disabling the smart shrink feature of webkit --- pkgs/tools/graphics/wkhtmltopdf/default.nix | 80 ++++++++++++++++++++++++--- pkgs/tools/graphics/wkhtmltopdf/makefix.patch | 24 ++++++++ pkgs/top-level/all-packages.nix | 5 +- 3 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 pkgs/tools/graphics/wkhtmltopdf/makefix.patch (limited to 'pkgs/tools') diff --git a/pkgs/tools/graphics/wkhtmltopdf/default.nix b/pkgs/tools/graphics/wkhtmltopdf/default.nix index 84b271acf2b..2f3929b82b8 100644 --- a/pkgs/tools/graphics/wkhtmltopdf/default.nix +++ b/pkgs/tools/graphics/wkhtmltopdf/default.nix @@ -1,22 +1,88 @@ -{ stdenv, fetchurl, qt4 }: +{ stdenv, fetchgit, qt4, fontconfig, freetype, libpng, zlib, libjpeg +, openssl, libX11, libXext, libXrender, overrideDerivation }: stdenv.mkDerivation rec { - name = "wkhtmltopdf-0.11.0_rc1"; + version = "0.12.1"; + name = "wkhtmltopdf-${version}"; - src = fetchurl { - url = "http://wkhtmltopdf.googlecode.com/files/${name}.tar.bz2"; - sha1 = "db03922d281856e503b3d562614e3936285728c7"; + src = fetchgit { + url = "https://github.com/wkhtmltopdf/wkhtmltopdf.git"; + rev = "refs/tags/${version}"; + sha256 = "0wjzaaviy1k3z8r2kzb2rmyx6xdj23a338b86sxcb15ws3kzwgwh"; }; - buildInputs = [ qt4 ]; + wkQt = overrideDerivation qt4 (deriv: { + name = "qt-mod-4.8.6"; + src = fetchgit { + url = "https://github.com/wkhtmltopdf/qt.git"; + rev = "82b568b"; # From git submodule spec in wkhtml repo. + sha256 = "0whppwxnymh5bdayqsqx54n074m99yk6v78z7f0k5prja55yvwyx"; + }; + configureFlags = + '' + -v -no-separate-debug-info -release -confirm-license -opensource + -qdbus -glib -dbus-linked -openssl-linked + '' + + # This is taken from the wkhtml build script that we don't run + '' + -fast + -static + -exceptions + -xmlpatterns + -webkit + -system-zlib + -system-libpng + -system-libjpeg + -no-libmng + -no-libtiff + -no-accessibility + -no-stl + -no-qt3support + -no-phonon + -no-phonon-backend + -no-opengl + -no-declarative + -no-sql-ibase + -no-sql-mysql + -no-sql-odbc + -no-sql-psql + -no-sql-sqlite + -no-sql-sqlite2 + -no-mmx + -no-3dnow + -no-sse + -no-sse2 + -no-multimedia + -nomake demos + -nomake docs + -nomake examples + -nomake tools + -nomake tests + -nomake translations + ''; + }); + + buildInputs = [ wkQt fontconfig freetype libpng zlib libjpeg openssl + libX11 libXext libXrender + ]; configurePhase = "qmake wkhtmltopdf.pro INSTALLBASE=$out"; + patches = [ ./makefix.patch ]; + enableParallelBuilding = true; meta = { - homepage = http://code.google.com/p/wkhtmltopdf/; + homepage = http://wkhtmltopdf.org/; description = "Tools for rendering web pages to PDF or images"; + longDescription = '' + wkhtmltopdf and wkhtmltoimage are open source (LGPL) command line tools + to render HTML into PDF and various image formats using the QT Webkit + rendering engine. These run entirely "headless" and do not require a + display or display service. + + There is also a C library, if you're into that kind of thing. + ''; license = stdenv.lib.licenses.gpl3Plus; }; } diff --git a/pkgs/tools/graphics/wkhtmltopdf/makefix.patch b/pkgs/tools/graphics/wkhtmltopdf/makefix.patch new file mode 100644 index 00000000000..0642a23afa9 --- /dev/null +++ b/pkgs/tools/graphics/wkhtmltopdf/makefix.patch @@ -0,0 +1,24 @@ +diff -Naur a/src/image/image.pro b/src/image/image.pro +--- a/src/image/image.pro 2014-08-28 14:07:51.024561967 +0200 ++++ b/src/image/image.pro 2014-08-28 14:08:22.383623390 +0200 +@@ -25,7 +25,7 @@ + + unix { + man.path=$$INSTALLBASE/share/man/man1 +- man.extra=LD_LIBRARY_PATH=../../bin/ ../../bin/wkhtmltoimage --manpage | gzip > $(INSTALL_ROOT)/share/man/man1/wkhtmltoimage.1.gz ++ man.extra=LD_LIBRARY_PATH=../../bin/ ../../bin/wkhtmltoimage --manpage | gzip > $$INSTALLBASE/share/man/man1/wkhtmltoimage.1.gz + + QMAKE_EXTRA_TARGETS += man + INSTALLS += man +diff -Naur a/src/pdf/pdf.pro b/src/pdf/pdf.pro +--- a/src/pdf/pdf.pro 2014-08-28 14:10:02.305818775 +0200 ++++ b/src/pdf/pdf.pro 2014-08-28 14:09:47.360789555 +0200 +@@ -25,7 +25,7 @@ + + unix { + man.path=$$INSTALLBASE/share/man/man1 +- man.extra=LD_LIBRARY_PATH=../../bin/ ../../bin/wkhtmltopdf --manpage | gzip > $(INSTALL_ROOT)/share/man/man1/wkhtmltopdf.1.gz ++ man.extra=LD_LIBRARY_PATH=../../bin/ ../../bin/wkhtmltopdf --manpage | gzip > $$INSTALLBASE/share/man/man1/wkhtmltopdf.1.gz + + QMAKE_EXTRA_TARGETS += man + INSTALLS += man diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0754239b849..e53f29483d4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2462,7 +2462,10 @@ let wicd = callPackage ../tools/networking/wicd { }; - wkhtmltopdf = callPackage ../tools/graphics/wkhtmltopdf { }; + wkhtmltopdf = callPackage ../tools/graphics/wkhtmltopdf { + overrideDerivation = lib.overrideDerivation; + inherit (xlibs) libX11 libXext libXrender; + }; wv = callPackage ../tools/misc/wv { }; -- cgit 1.4.1 From aaa7e89a93eb54babb8facfcd214263e907788d9 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Tue, 2 Sep 2014 02:51:24 -0400 Subject: [screenfetch] Bump to the stable release Signed-off-by: Ricky Elrod --- pkgs/tools/misc/screenfetch/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/screenfetch/default.nix b/pkgs/tools/misc/screenfetch/default.nix index 0ebc712fcf0..826f4e4d869 100644 --- a/pkgs/tools/misc/screenfetch/default.nix +++ b/pkgs/tools/misc/screenfetch/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchgit, xdpyinfo, xprop }: let - version = "2014-05-27"; + version = "3.6.2"; in stdenv.mkDerivation { name = "screenFetch-${version}"; @@ -9,8 +9,8 @@ stdenv.mkDerivation { src = fetchgit { url = git://github.com/KittyKatt/screenFetch.git; - rev = "69c46cb94b5765dbcb36905c5a35c42eb8e6e470"; - sha256 = "0479na831120bpyrg5nb3nb1jr8p8ahkixk1znwg730q3vdcjd6j"; + rev = "dec1cd6c2471defe4459967fbc8ae15b55714338"; + sha256 = "138a7g0za5dq27jx7x8gqg7gjkgyq0017v0nbcg68ys7dqlxsdl3"; }; installPhase = '' -- cgit 1.4.1 From ef8220d1bf6143d73be248fcfb58f14d1c4d987f Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 2 Sep 2014 14:11:09 +0200 Subject: Expose Android NDK in the top level expression --- pkgs/tools/package-management/disnix/default.nix | 6 +++--- pkgs/tools/package-management/disnix/disnixos/default.nix | 6 +++--- pkgs/tools/package-management/disnix/dysnomia/default.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/package-management/disnix/default.nix b/pkgs/tools/package-management/disnix/default.nix index 61e998fd545..b6b88aef022 100644 --- a/pkgs/tools/package-management/disnix/default.nix +++ b/pkgs/tools/package-management/disnix/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, pkgconfig, dbus_glib, libxml2, libxslt, getopt, nixUnstable, dysnomia, libintlOrEmpty, libiconvOrEmpty }: stdenv.mkDerivation { - name = "disnix-0.3pre174e883b7b09da822494876d2f297736f33707a7"; + name = "disnix-0.3pre24d959b3b37ce285971810245643a7f18cb85fcc"; src = fetchurl { - url = http://hydra.nixos.org/build/11773951/download/4/disnix-0.3pre174e883b7b09da822494876d2f297736f33707a7.tar.gz; - sha256 = "19hdh2mrlyiq1g3z6lnnqqvripmfcdnm18jpm4anp5iarhnwh3y4"; + url = http://hydra.nixos.org/build/13612993/download/4/disnix-0.3pre24d959b3b37ce285971810245643a7f18cb85fcc.tar.gz; + sha256 = "0ml8g6h7x79mvv84il9vb9b88kqak9m3yzavmar66i3dvyqr1dwb"; }; buildInputs = [ pkgconfig dbus_glib libxml2 libxslt getopt nixUnstable libintlOrEmpty libiconvOrEmpty dysnomia ]; diff --git a/pkgs/tools/package-management/disnix/disnixos/default.nix b/pkgs/tools/package-management/disnix/disnixos/default.nix index 65ae91f6e18..0190a5fd679 100644 --- a/pkgs/tools/package-management/disnix/disnixos/default.nix +++ b/pkgs/tools/package-management/disnix/disnixos/default.nix @@ -1,11 +1,11 @@ { stdenv, fetchurl, disnix, socat, pkgconfig, getopt }: stdenv.mkDerivation { - name = "disnixos-0.2prebb320d396f93d7062c28d6a54105d8e8196b9d99"; + name = "disnixos-0.2prec3310e2d8975c45e4ffacec940049fb781739b8d"; src = fetchurl { - url = http://hydra.nixos.org/build/9877039/download/3/disnixos-0.2preb10c56eeb1be3046645eea90c779e2d64045581f.tar.gz; - sha256 = "1pkpf6vp9q3jjp212lghbs1km8iqh4rm9xa5jm0dqb5ya25f0jf2"; + url = http://hydra.nixos.org/build/13617499/download/3/disnixos-0.2prec3310e2d8975c45e4ffacec940049fb781739b8d.tar.gz; + sha256 = "1kcpzzwy9jc1zz700whnp6sc77yp3wxzr935f07jy55ddkl8mdi5"; }; buildInputs = [ socat pkgconfig disnix getopt ]; diff --git a/pkgs/tools/package-management/disnix/dysnomia/default.nix b/pkgs/tools/package-management/disnix/dysnomia/default.nix index a1914224dbd..574bf8f9ab3 100644 --- a/pkgs/tools/package-management/disnix/dysnomia/default.nix +++ b/pkgs/tools/package-management/disnix/dysnomia/default.nix @@ -19,10 +19,10 @@ assert enableEjabberdDump -> ejabberd != null; assert enableMongoDatabase -> mongodb != null; stdenv.mkDerivation { - name = "dysnomia-0.3pre09cc08f5ffc737d988923bb7329a7ec711badd82"; + name = "dysnomia-0.3precf347cbd508f488f115f8961371a3cecf03fd530"; src = fetchurl { - url = http://hydra.nixos.org/build/11407191/download/1/dysnomia-0.3pre09cc08f5ffc737d988923bb7329a7ec711badd82.tar.gz; - sha256 = "1i7yb299bq1z7cy4sk83m5faahj8inh73xn5bi6jcv492zv3kgwz"; + url = http://hydra.nixos.org/build/13281061/download/1/dysnomia-0.3precf347cbd508f488f115f8961371a3cecf03fd530.tar.gz; + sha256 = "0xiqpz2c3dh4pbdprvrd7plvq3ipngqbjkwpmbhw1nw90x5rpa2d"; }; preConfigure = if enableEjabberdDump then "export PATH=$PATH:${ejabberd}/sbin" else ""; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d2d0f69132c..05c9d695bc2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -528,7 +528,7 @@ let pkgs_i686 = pkgsi686Linux; }; - inherit (androidenv) androidsdk_4_1; + inherit (androidenv) androidsdk_4_4 androidndk; aria2 = callPackage ../tools/networking/aria2 { }; aria = aria2; -- cgit 1.4.1 From 36614ff3e290a9330dd8e29bdc6cc38ede1e7001 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 31 Aug 2014 09:18:13 -0700 Subject: Revert "Revert "Merge pull request #2449 from wkennington/master.grub"" This reverts commit 94205f5f21c4d9942bb4205c06229438051b6853. Conflicts: nixos/modules/system/boot/loader/grub/install-grub.pl --- .../installer/tools/nixos-generate-config.pl | 21 ++++ nixos/modules/installer/tools/tools.nix | 1 + nixos/modules/installer/virtualbox-demo.nix | 3 + nixos/modules/system/boot/loader/grub/grub.nix | 37 ++++-- .../system/boot/loader/grub/install-grub.pl | 135 ++++++++++++++++++--- nixos/modules/tasks/filesystems/zfs.nix | 6 +- nixos/release-combined.nix | 4 + nixos/release.nix | 2 +- nixos/tests/installer.nix | 13 +- pkgs/tools/misc/grub/2.0x.nix | 62 +++++----- pkgs/top-level/all-packages.nix | 6 +- 11 files changed, 224 insertions(+), 66 deletions(-) (limited to 'pkgs/tools') diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index 66a8152a3a6..73dd87cef5c 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -20,6 +20,13 @@ sub uniq { return @res; } +sub runCommand { + my ($cmd) = @_; + open FILE, "$cmd 2>/dev/null |" or die "Failed to execute: $cmd\n"; + my @ret = ; + close FILE; + return ($?, @ret); +} # Process the command line. my $outDir = "/etc/nixos"; @@ -337,6 +344,20 @@ EOF } } + # Is this a btrfs filesystem? + if ($fsType eq "btrfs") { + my ($status, @info) = runCommand("btrfs subvol show $rootDir$mountPoint"); + if ($status != 0) { + die "Failed to retreive subvolume info for $mountPoint"; + } + my @subvols = join("", @info) =~ m/Name:[ \t\n]*([^ \t\n]*)/; + if ($#subvols > 0) { + die "Btrfs subvol name for $mountPoint listed multiple times in mount\n" + } elsif ($#subvols == 0) { + push @extraOptions, "subvol=$subvols[0]"; + } + } + # Emit the filesystem. $fileSystems .= <df or + mount. Note, zfs zpools / datasets are ignored + and will always be mounted using their labels. + ''; + }; + + zfsSupport = mkOption { + default = false; + type = types.bool; + description = '' + Whether grub should be build against libzfs. ''; }; @@ -260,6 +276,9 @@ in ${pkgs.coreutils}/bin/cp -pf "${v}" "/boot/${n}" '') config.boot.loader.grub.extraFiles); + assertions = [{ assertion = !cfg.zfsSupport || cfg.version == 2; + message = "Only grub version 2 provides zfs support";}]; + }) ]; diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index b4900358a5d..7ced51f57e1 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -1,5 +1,6 @@ use strict; use warnings; +use Class::Struct; use XML::LibXML; use File::Basename; use File::Path; @@ -27,6 +28,14 @@ sub writeFile { close FILE or die; } +sub runCommand { + my ($cmd) = @_; + open FILE, "$cmd 2>/dev/null |" or die "Failed to execute: $cmd\n"; + my @ret = ; + close FILE; + return ($?, @ret); +} + my $grub = get("grub"); my $grubVersion = int(get("version")); my $extraConfig = get("extraConfig"); @@ -39,7 +48,7 @@ my $configurationLimit = int(get("configurationLimit")); my $copyKernels = get("copyKernels") eq "true"; my $timeout = int(get("timeout")); my $defaultEntry = int(get("default")); -my $explicitBootRoot = get("explicitBootRoot"); +my $fsIdentifier = get("fsIdentifier"); $ENV{'PATH'} = get("path"); die "unsupported GRUB version\n" if $grubVersion != 1 && $grubVersion != 2; @@ -48,22 +57,108 @@ print STDERR "updating GRUB $grubVersion menu...\n"; mkpath("/boot/grub", 0, 0700); - # Discover whether /boot is on the same filesystem as / and # /nix/store. If not, then all kernels and initrds must be copied to -# /boot, and all paths in the GRUB config file must be relative to the -# root of the /boot filesystem. `$bootRoot' is the path to be -# prepended to paths under /boot. -my $bootRoot = "/boot"; -if (stat("/")->dev != stat("/boot")->dev) { - $bootRoot = ""; - $copyKernels = 1; -} elsif (stat("/boot")->dev != stat("/nix/store")->dev) { +# /boot. +if (stat("/boot")->dev != stat("/nix/store")->dev) { $copyKernels = 1; } -if ($explicitBootRoot ne "") { - $bootRoot = $explicitBootRoot; +# Discover information about the location of /boot +struct(Fs => { + device => '$', + type => '$', + mount => '$', +}); +sub GetFs { + my ($dir) = @_; + my ($status, @dfOut) = runCommand("df -T $dir"); + if ($status != 0 || $#dfOut != 1) { + die "Failed to retrieve output about $dir from `df`"; + } + my @boot = split(/[ \n\t]+/, $dfOut[1]); + return Fs->new(device => $boot[0], type => $boot[1], mount => $boot[6]); +} +struct (Grub => { + path => '$', + search => '$', +}); +my $driveid = 1; +sub GrubFs { + my ($dir) = @_; + my $fs = GetFs($dir); + my $path = "/" . substr($dir, length($fs->mount)); + my $search = ""; + + if ($grubVersion > 1) { + # ZFS is completely separate logic as zpools are always identified by a label + # or custom UUID + if ($fs->type eq 'zfs') { + my $sid = index($fs->device, '/'); + + if ($sid < 0) { + $search = '--label ' . $fs->device; + $path = '/@' . $path; + } else { + $search = '--label ' . substr($fs->device, 0, $sid); + $path = '/' . substr($fs->device, $sid) . '/@' . $path; + } + } else { + my %types = ('uuid' => '--fs-uuid', 'label' => '--label'); + + if ($fsIdentifier eq 'provided') { + # If the provided dev is identifying the partition using a label or uuid, + # we should get the label / uuid and do a proper search + my @matches = $fs->device =~ m/\/dev\/disk\/by-(label|uuid)\/(.*)/; + if ($#matches > 1) { + die "Too many matched devices" + } elsif ($#matches == 1) { + $search = "$types{$matches[0]} $matches[1]" + } + } else { + # Determine the identifying type + $search = $types{$fsIdentifier} . ' '; + + # Based on the type pull in the identifier from the system + my ($status, @devInfo) = runCommand("blkid -o export @{[$fs->device]}"); + if ($status != 0) { + die "Failed to get blkid info for @{[$fs->device]}"; + } + my @matches = join("", @devInfo) =~ m/@{[uc $fsIdentifier]}=([^\n]*)/; + if ($#matches != 0) { + die "Couldn't find a $types{$fsIdentifier} for @{[$fs->device]}\n" + } + $search .= $matches[0]; + } + + # BTRFS is a special case in that we need to fix the referrenced path based on subvolumes + if ($fs->type eq 'btrfs') { + my ($status, @info) = runCommand("btrfs subvol show @{[$fs->mount]}"); + if ($status != 0) { + die "Failed to retreive subvolume info for @{[$fs->mount]}"; + } + my @subvols = join("", @info) =~ m/Name:[ \t\n]*([^ \t\n]*)/; + if ($#subvols > 0) { + die "Btrfs subvol name for @{[$fs->device]} listed multiple times in mount\n" + } elsif ($#subvols == 0) { + $path = "/$subvols[0]$path"; + } + } + } + if (not $search eq "") { + $search = "search --set=drive$driveid " . $search; + $path = "(\$drive$driveid)$path"; + $driveid += 1; + } + } + return Grub->new(path => $path, search => $search); +} +my $grubBoot = GrubFs("/boot"); +my $grubStore = GrubFs("/nix"); + +# We don't need to copy if we can read the kernels directly +if ($grubStore->search ne "") { + $copyKernels = 0; } # Generate the header. @@ -76,12 +171,14 @@ if ($grubVersion == 1) { "; if ($splashImage) { copy $splashImage, "/boot/background.xpm.gz" or die "cannot copy $splashImage to /boot\n"; - $conf .= "splashimage $bootRoot/background.xpm.gz\n"; + $conf .= "splashimage " . $grubBoot->path . "/background.xpm.gz\n"; } } else { $conf .= " + " . $grubBoot->search . " + " . $grubStore->search . " if [ -s \$prefix/grubenv ]; then load_env fi @@ -102,7 +199,7 @@ else { set timeout=$timeout fi - if loadfont $bootRoot/grub/fonts/unicode.pf2; then + if loadfont " . $grubBoot->path . "/grub/fonts/unicode.pf2; then set gfxmode=640x480 insmod gfxterm insmod vbe @@ -116,7 +213,7 @@ else { copy $splashImage, "/boot/background.png" or die "cannot copy $splashImage to /boot\n"; $conf .= " insmod png - if background_image $bootRoot/background.png; then + if background_image " . $grubBoot->path . "/background.png; then set color_normal=white/black set color_highlight=black/white else @@ -138,7 +235,7 @@ mkpath("/boot/kernels", 0, 0755) if $copyKernels; sub copyToKernelsDir { my ($path) = @_; - return $path unless $copyKernels; + return $grubStore->path . substr($path, length("/nix")) unless $copyKernels; $path =~ /\/nix\/store\/(.*)/ or die; my $name = $1; $name =~ s/\//-/g; my $dst = "/boot/kernels/$name"; @@ -151,7 +248,7 @@ sub copyToKernelsDir { rename $tmp, $dst or die "cannot rename $tmp to $dst\n"; } $copied{$dst} = 1; - return "$bootRoot/kernels/$name"; + return $grubBoot->path . "/kernels/$name"; } sub addEntry { @@ -178,6 +275,8 @@ sub addEntry { $conf .= " " . ($xen ? "module" : "initrd") . " $initrd\n\n"; } else { $conf .= "menuentry \"$name\" {\n"; + $conf .= $grubBoot->search . "\n"; + $conf .= $grubStore->search . "\n"; $conf .= " $extraPerEntryConfig\n" if $extraPerEntryConfig; $conf .= " multiboot $xen $xenParams\n" if $xen; $conf .= " " . ($xen ? "module" : "linux") . " $kernel $kernelParams\n"; @@ -195,7 +294,7 @@ addEntry("NixOS - Default", $defaultConfig); $conf .= "$extraEntries\n" unless $extraEntriesBeforeNixOS; # extraEntries could refer to @bootRoot@, which we have to substitute -$conf =~ s/\@bootRoot\@/$bootRoot/g; +$conf =~ s/\@bootRoot\@/$grubBoot->path/g; # Emit submenus for all system profiles. sub addProfile { diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index d7deb44c407..1c4bbc16b49 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -133,7 +133,7 @@ in }; boot.initrd = mkIf inInitrd { - kernelModules = [ "spl" "zfs" ] ; + kernelModules = [ "spl" "zfs" ]; extraUtilsCommands = '' cp -v ${zfsPkg}/sbin/zfs $out/bin @@ -148,6 +148,10 @@ in ''; }; + boot.loader.grub = mkIf inInitrd { + zfsSupport = true; + }; + systemd.services."zpool-import" = { description = "Import zpools"; after = [ "systemd-udev-settle.service" ]; diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index dae3b9210a8..23348e1d089 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -52,6 +52,10 @@ in rec { (all nixos.tests.installer.lvm) (all nixos.tests.installer.separateBoot) (all nixos.tests.installer.simple) + (all nixos.tests.installer.simpleLabels) + (all nixos.tests.installer.simpleProvided) + (all nixos.tests.installer.btrfsSimple) + (all nixos.tests.installer.btrfsSubvols) (all nixos.tests.ipv6) (all nixos.tests.kde4) (all nixos.tests.login) diff --git a/nixos/release.nix b/nixos/release.nix index e2b93640f91..f78ecb4383d 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -231,7 +231,7 @@ in rec { tests.installer.simpleLabels = forAllSystems (system: (import tests/installer.nix { inherit system; }).simpleLabels.test); tests.installer.simpleProvided = forAllSystems (system: (import tests/installer.nix { inherit system; }).simpleProvided.test); tests.installer.btrfsSimple = forAllSystems (system: (import tests/installer.nix { inherit system; }).btrfsSimple.test); - #tests.installer.btrfsSubvols = forAllSystems (system: (import tests/installer.nix { inherit system; }).btrfsSubvols.test); + tests.installer.btrfsSubvols = forAllSystems (system: (import tests/installer.nix { inherit system; }).btrfsSubvols.test); tests.influxdb = callTest tests/influxdb.nix {}; tests.ipv6 = callTest tests/ipv6.nix {}; tests.jenkins = callTest tests/jenkins.nix {}; diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 6ee52fd63d8..154f3323d29 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -35,8 +35,8 @@ let # The configuration to install. - makeConfig = { testChannel, useEFI, grubVersion, grubDevice }: pkgs.writeText "configuration.nix" - '' + makeConfig = { testChannel, useEFI, grubVersion, grubDevice, grubIdentifier }: + pkgs.writeText "configuration.nix" '' { config, pkgs, modulesPath, ... }: { imports = @@ -54,6 +54,7 @@ let ''} boot.loader.grub.device = "${grubDevice}"; boot.loader.grub.extraConfig = "serial; terminal_output.serial"; + boot.loader.grub.fsIdentifier = "${grubIdentifier}"; ''} environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ]; @@ -93,7 +94,7 @@ let # disk, and then reboot from the hard disk. It's parameterized with # a test script fragment `createPartitions', which must create # partitions and filesystems. - testScriptFun = { createPartitions, testChannel, useEFI, grubVersion, grubDevice }: + testScriptFun = { createPartitions, testChannel, useEFI, grubVersion, grubDevice, grubIdentifier }: let # FIXME: OVMF doesn't boot from virtio http://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg01501.html iface = if useEFI || grubVersion == 1 then "scsi" else "virtio"; @@ -161,7 +162,7 @@ let $machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2"); $machine->copyFileFromHost( - "${ makeConfig { inherit testChannel useEFI grubVersion grubDevice; } }", + "${ makeConfig { inherit testChannel useEFI grubVersion grubDevice grubIdentifier; } }", "/mnt/etc/nixos/configuration.nix"); # Perform the installation. @@ -216,13 +217,13 @@ let makeInstallerTest = name: - { createPartitions, testChannel ? false, useEFI ? false, grubVersion ? 2, grubDevice ? "/dev/vda" }: + { createPartitions, testChannel ? false, useEFI ? false, grubVersion ? 2, grubDevice ? "/dev/vda", grubIdentifier ? "uuid" }: makeTest { inherit iso; name = "installer-" + name; nodes = if testChannel then { inherit webserver; } else { }; testScript = testScriptFun { - inherit createPartitions testChannel useEFI grubVersion grubDevice; + inherit createPartitions testChannel useEFI grubVersion grubDevice grubIdentifier; }; }; diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index b1877bdcf98..e3c07af759c 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,30 +1,45 @@ -{ fetchurl, stdenv, flex, bison, gettext, ncurses, libusb, freetype, qemu -, devicemapper, EFIsupport ? false }: - +{ stdenv, fetchurl, autogen, flex, bison, python, autoconf, automake +, gettext, ncurses, libusb, freetype, qemu, devicemapper +, linuxPackages ? null +, efiSupport ? false +, zfsSupport ? false +}: + +with stdenv.lib; let + efiSystems = { + "i686-linux".target = "i386"; + "x86_64-linux".target = "x86_64"; + }; - prefix = "grub${if EFIsupport then "-efi" else ""}"; + canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystems); - version = "2.00"; + prefix = "grub${if efiSupport then "-efi" else ""}"; + + version = "2.02-beta2"; unifont_bdf = fetchurl { url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx"; }; +in ( -in +assert efiSupport -> canEfi; +assert zfsSupport -> linuxPackages != null && linuxPackages.zfs != null; stdenv.mkDerivation rec { name = "${prefix}-${version}"; src = fetchurl { - url = "mirror://gnu/grub/grub-${version}.tar.xz"; - sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq"; + name = "grub-2.02-beta2.tar.xz"; + url = "http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.xz"; + sha256 = "13a13fhc0wf473dn73zhga15mjvkg6vqp4h25dxg4n7am2r05izn"; }; - nativeBuildInputs = [ flex bison ]; + nativeBuildInputs = [ autogen flex bison python autoconf automake ]; buildInputs = [ ncurses libusb freetype gettext devicemapper ] - ++ stdenv.lib.optional doCheck qemu; + ++ optional doCheck qemu + ++ optional zfsSupport linuxPackages.zfs; preConfigure = '' for i in "tests/util/"*.in @@ -43,27 +58,19 @@ stdenv.mkDerivation rec { # See . sed -i "tests/util/grub-shell.in" \ -e's/qemu-system-i386/qemu-system-x86_64 -nodefaults/g' - - # Fix for building on Glibc 2.16. Won't be needed once the - # gnulib in grub is updated. - sed -i '/gets is a security hole/d' grub-core/gnulib/stdio.in.h ''; prePatch = - '' gunzip < "${unifont_bdf}" > "unifont.bdf" + '' sh autogen.sh + gunzip < "${unifont_bdf}" > "unifont.bdf" sed -i "configure" \ -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g" ''; patches = [ ./fix-bash-completion.patch ]; - configureFlags = - let arch = if stdenv.system == "i686-linux" then "i386" - else if stdenv.system == "x86_64-linux" then "x86_64" - else throw "unsupported EFI firmware architecture"; - in - stdenv.lib.optionals EFIsupport - [ "--with-platform=efi" "--target=${arch}" "--program-prefix=" ]; + configureFlags = optional zfsSupport "--enable-libzfs" + ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystems.${stdenv.system}.target}" "--program-prefix=" ]; doCheck = false; enableParallelBuilding = true; @@ -72,7 +79,7 @@ stdenv.mkDerivation rec { paxmark pms $out/sbin/grub-{probe,bios-setup} ''; - meta = { + meta = with stdenv.lib; { description = "GNU GRUB, the Grand Unified Boot Loader (2.x beta)"; longDescription = @@ -89,11 +96,8 @@ stdenv.mkDerivation rec { homepage = http://www.gnu.org/software/grub/; - license = stdenv.lib.licenses.gpl3Plus; + license = licenses.gpl3Plus; - platforms = if EFIsupport then - [ "i686-linux" "x86_64-linux" ] - else - stdenv.lib.platforms.gnu; + platforms = platforms.gnu; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05c9d695bc2..6e5caa3af9e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1235,9 +1235,11 @@ let buggyBiosCDSupport = config.grub.buggyBiosCDSupport or true; }; - grub2 = callPackage ../tools/misc/grub/2.0x.nix { libusb = libusb1; flex = flex_2_5_35; }; + grub2 = callPackage ../tools/misc/grub/2.0x.nix { }; - grub2_efi = grub2.override { EFIsupport = true; }; + grub2_efi = grub2.override { efiSupport = true; }; + + grub2_zfs = grub2.override { zfsSupport = true; }; gssdp = callPackage ../development/libraries/gssdp { inherit (gnome) libsoup; -- cgit 1.4.1 From ac502d28ff4fabd8fb97c45c209e67c0d35d184a Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 23 Aug 2014 14:05:31 -0700 Subject: tinc_pre: Add derivation The tinc developer has made significant developments to the next version of tinc including many protocol security fixes. This patch adds the prerelease of the next major tinc release. --- pkgs/tools/networking/tinc/pre.nix | 33 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/tools/networking/tinc/pre.nix (limited to 'pkgs/tools') diff --git a/pkgs/tools/networking/tinc/pre.nix b/pkgs/tools/networking/tinc/pre.nix new file mode 100644 index 00000000000..b2a7ca53728 --- /dev/null +++ b/pkgs/tools/networking/tinc/pre.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchgit, autoreconfHook, texinfo, ncurses, readline, zlib, lzo, openssl }: + +stdenv.mkDerivation rec { + version = "1.1pre78bf82c"; + name = "tinc-${version}"; + + src = fetchgit { + url = "git://tinc-vpn.org/tinc"; + rev = "78bf82cf332327889f0f61388b73053850d8e59b"; + sha256 = "0azjy78qrzpk16b5jm08kx01ln2j9q0q69g86ah60fms525w1xjk"; + }; + + buildInputs = [ autoreconfHook texinfo ncurses readline zlib lzo openssl ]; + + configureFlags = [ + "--sysconfdir=/etc" + "--localstatedir=/var" + ]; + + meta = with stdenv.lib; { + description = "VPN daemon with full mesh routing"; + longDescription = '' + tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and + encryption to create a secure private network between hosts on the + Internet. It features full mesh routing, as well as encryption, + authentication, compression and ethernet bridging. + ''; + homepage="http://www.tinc-vpn.org/"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ wkennington ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 05c9d695bc2..eee5ed3d9b0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2260,6 +2260,8 @@ let tinc = callPackage ../tools/networking/tinc { }; + tinc_pre = callPackage ../tools/networking/tinc/pre.nix { }; + tiny8086 = callPackage ../applications/virtualization/8086tiny { }; tmpwatch = callPackage ../tools/misc/tmpwatch { }; -- cgit 1.4.1 From d13423c74f93620c1b8810e9818bbb025016d137 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 24 Aug 2014 19:53:13 -0700 Subject: tinc_pre: Experimental Patches --- pkgs/tools/networking/tinc/pre.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/networking/tinc/pre.nix b/pkgs/tools/networking/tinc/pre.nix index b2a7ca53728..030cb30a150 100644 --- a/pkgs/tools/networking/tinc/pre.nix +++ b/pkgs/tools/networking/tinc/pre.nix @@ -1,13 +1,12 @@ { stdenv, fetchgit, autoreconfHook, texinfo, ncurses, readline, zlib, lzo, openssl }: stdenv.mkDerivation rec { - version = "1.1pre78bf82c"; - name = "tinc-${version}"; + name = "tinc-1.1pre38d7e73"; src = fetchgit { url = "git://tinc-vpn.org/tinc"; - rev = "78bf82cf332327889f0f61388b73053850d8e59b"; - sha256 = "0azjy78qrzpk16b5jm08kx01ln2j9q0q69g86ah60fms525w1xjk"; + rev = "38d7e730e619a8b86dfbf68d77773564595f12a1"; + sha256 = "0xac1jm6x9lkybd6sz8lfcdrb8h69kh1ckg35ag1rssr45hxikbz"; }; buildInputs = [ autoreconfHook texinfo ncurses readline zlib lzo openssl ]; -- cgit 1.4.1 From 0ede64bfcb18430f2e5d5b4079a173f809947b0e Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Tue, 2 Sep 2014 21:17:52 +0400 Subject: Override postFixup for urlwatch so it works somehwo --- pkgs/tools/networking/urlwatch/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/tools') diff --git a/pkgs/tools/networking/urlwatch/default.nix b/pkgs/tools/networking/urlwatch/default.nix index 4843f07c8f2..1be71942e70 100644 --- a/pkgs/tools/networking/urlwatch/default.nix +++ b/pkgs/tools/networking/urlwatch/default.nix @@ -12,6 +12,10 @@ python3Packages.buildPythonPackage rec { ./convert-to-python3.sh ''; + postFixup = '' + wrapProgram "$out/bin/urlwatch" --prefix "PYTHONPATH" : "$PYTHONPATH" + ''; + meta = { description = "A tool for monitoring webpages for updates"; homepage = https://thp.io/2008/urlwatch/; -- cgit 1.4.1 From c369c4afbd8ca0e1d43e53408383bb623fe41a79 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 2 Sep 2014 18:57:09 -0700 Subject: grub2: Fix zfs support --- pkgs/tools/misc/grub/2.0x.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index e3c07af759c..fdb2ae556e8 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, autogen, flex, bison, python, autoconf, automake +{ stdenv, fetchurl, fetchgit, autogen, flex, bison, python, autoconf, automake , gettext, ncurses, libusb, freetype, qemu, devicemapper , linuxPackages ? null , efiSupport ? false @@ -14,9 +14,9 @@ let canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystems); - prefix = "grub${if efiSupport then "-efi" else ""}"; + prefix = "grub${if efiSupport then "-efi" else ""}${optionalString zfsSupport "-zfs"}"; - version = "2.02-beta2"; + version = "2.02-git-1de3a4"; unifont_bdf = fetchurl { url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; @@ -30,10 +30,10 @@ assert zfsSupport -> linuxPackages != null && linuxPackages.zfs != null; stdenv.mkDerivation rec { name = "${prefix}-${version}"; - src = fetchurl { - name = "grub-2.02-beta2.tar.xz"; - url = "http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.xz"; - sha256 = "13a13fhc0wf473dn73zhga15mjvkg6vqp4h25dxg4n7am2r05izn"; + src = fetchgit { + url = "git://git.savannah.gnu.org/grub.git"; + rev = "1de3a48098053aaebd35232bd73e3ce3f3fdf51c"; + sha256 = "0d1953nmi251czkm1dmd7vnm3iz2rkqbznlp6ph33va0d7kw1kfc"; }; nativeBuildInputs = [ autogen flex bison python autoconf automake ]; -- cgit 1.4.1 From 74343ca3abe9968e1f59eda56627023a07270440 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 3 Sep 2014 10:11:18 +0400 Subject: Fix handling of paths with multuple mounts — for example rootfs first mount for / MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/tools/filesystems/btrfsprogs/default.nix | 2 ++ pkgs/tools/filesystems/btrfsprogs/multiple_mounts.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/tools/filesystems/btrfsprogs/multiple_mounts.patch (limited to 'pkgs/tools') diff --git a/pkgs/tools/filesystems/btrfsprogs/default.nix b/pkgs/tools/filesystems/btrfsprogs/default.nix index 02f214ad430..79566d15bb9 100644 --- a/pkgs/tools/filesystems/btrfsprogs/default.nix +++ b/pkgs/tools/filesystems/btrfsprogs/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt ]; + patches = [ ./multiple_mounts.patch ]; + # for btrfs to get the rpath to libgcc_s, needed for pthread_cancel to work NIX_CFLAGS_LINK = "-lgcc_s"; diff --git a/pkgs/tools/filesystems/btrfsprogs/multiple_mounts.patch b/pkgs/tools/filesystems/btrfsprogs/multiple_mounts.patch new file mode 100644 index 00000000000..0ba6550a2d3 --- /dev/null +++ b/pkgs/tools/filesystems/btrfsprogs/multiple_mounts.patch @@ -0,0 +1,13 @@ +Only in btrfs-progs-v3.16-orig: btrfs-progs-v3.16 +diff -U3 -r btrfs-progs-v3.16-orig/utils.c btrfs-progs-v3.16/utils.c +--- btrfs-progs-v3.16-orig/utils.c 2014-09-03 09:57:45.644858545 +0400 ++++ btrfs-progs-v3.16/utils.c 2014-09-03 09:59:26.968855663 +0400 +@@ -2360,7 +2360,7 @@ + len = strlen(ent->mnt_dir); + if (strncmp(ent->mnt_dir, path, len) == 0) { + /* match found */ +- if (longest_matchlen < len) { ++ if ((longest_matchlen < len) || (longest_matchlen==len && not_btrfs)) { + free(longest_match); + longest_matchlen = len; + longest_match = strdup(ent->mnt_dir); -- cgit 1.4.1 From 88d270f62e268c4cd36bc6e181ee885e21167376 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 3 Sep 2014 01:06:04 -0700 Subject: grub2: Add localizations --- pkgs/tools/misc/grub/2.0x.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix index fdb2ae556e8..e5471a6c404 100644 --- a/pkgs/tools/misc/grub/2.0x.nix +++ b/pkgs/tools/misc/grub/2.0x.nix @@ -22,6 +22,13 @@ let url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz"; sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx"; }; + + po_src = fetchurl { + name = "grub-2.02-beta2.tar.gz"; + url = "http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz"; + sha256 = "1lr9h3xcx0wwrnkxdnkfjwy08j7g7mdlmmbdip2db4zfgi69h0rm"; + }; + in ( assert efiSupport -> canEfi; @@ -61,7 +68,10 @@ stdenv.mkDerivation rec { ''; prePatch = - '' sh autogen.sh + '' tar zxf ${po_src} grub-2.02~beta2/po + rm -rf po + mv grub-2.02~beta2/po po + sh autogen.sh gunzip < "${unifont_bdf}" > "unifont.bdf" sed -i "configure" \ -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g" -- cgit 1.4.1 From 2b72edad9b3c2426600b27e48e70f2e038382313 Mon Sep 17 00:00:00 2001 From: Sergey Mironov Date: Sun, 30 Mar 2014 00:07:31 +0400 Subject: yandex-disk: fix the url; introduce systemd.service #2228 --- nixos/modules/misc/ids.nix | 1 + nixos/modules/module-list.nix | 1 + .../services/network-filesystems/yandex-disk.nix | 104 +++++++++++++++++++++ pkgs/tools/filesystems/yandex-disk/default.nix | 6 +- 4 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 nixos/modules/services/network-filesystems/yandex-disk.nix (limited to 'pkgs/tools') diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index d72649cd33d..a535a8d7604 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -150,6 +150,7 @@ zookeeper = 140; dnsmasq = 141; uhub = 142; + yandexdisk=143; # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7679d3e6ac4..1135534263c 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -193,6 +193,7 @@ ./services/network-filesystems/rsyncd.nix ./services/network-filesystems/samba.nix ./services/network-filesystems/diod.nix + ./services/network-filesystems/yandex-disk.nix ./services/networking/amuled.nix ./services/networking/atftpd.nix ./services/networking/avahi-daemon.nix diff --git a/nixos/modules/services/network-filesystems/yandex-disk.nix b/nixos/modules/services/network-filesystems/yandex-disk.nix new file mode 100644 index 00000000000..df9626d17c9 --- /dev/null +++ b/nixos/modules/services/network-filesystems/yandex-disk.nix @@ -0,0 +1,104 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + cfg = config.services.yandex-disk; + + dir = "/var/lib/yandex-disk"; + + u = if cfg.user != null then cfg.user else "yandexdisk"; + +in + +{ + + ###### interface + + options = { + + services.yandex-disk = { + + enable = mkOption { + default = false; + description = " + Whether to enable Yandex-disk client. See https://disk.yandex.ru/ + "; + }; + + username = mkOption { + default = ""; + type = types.string; + description = '' + Your yandex.com login name. + ''; + }; + + password = mkOption { + default = ""; + type = types.string; + description = '' + Your yandex.com password. Warning: it will be world-readable in /nix/store. + ''; + }; + + user = mkOption { + default = null; + description = '' + The user the yandex-disk daemon should run as. + ''; + }; + + directory = mkOption { + default = "/home/Yandex.Disk"; + description = "The directory to use for Yandex.Disk storage"; + }; + + }; + + }; + + + ###### implementation + + config = mkIf cfg.enable { + + users.extraUsers = mkIf (cfg.user == null) [ { + name = u; + uid = config.ids.uids.yandexdisk; + group = "nogroup"; + home = dir; + } ]; + + systemd.services.yandex-disk = { + description = "Yandex-disk server"; + + after = [ "network.target" ]; + + wantedBy = [ "multi-user.target" ]; + + # FIXME: have to specify ${directory} here as well + unitConfig.RequiresMountsFor = dir; + + script = '' + mkdir -p -m 700 ${dir} + chown ${u} ${dir} + + if ! test -d "${cfg.directory}" ; then + mkdir -p -m 755 ${cfg.directory} || + exit 1 + fi + + ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${u} \ + -c '${pkgs.yandex-disk}/bin/yandex-disk token -p ${cfg.password} ${cfg.username} ${dir}/token' + + ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${u} \ + -c '${pkgs.yandex-disk}/bin/yandex-disk start --no-daemon -a ${dir}/token -d ${cfg.directory}' + ''; + + }; + }; + +} + diff --git a/pkgs/tools/filesystems/yandex-disk/default.nix b/pkgs/tools/filesystems/yandex-disk/default.nix index c9078a0cb8b..e33f46ea9cc 100644 --- a/pkgs/tools/filesystems/yandex-disk/default.nix +++ b/pkgs/tools/filesystems/yandex-disk/default.nix @@ -6,17 +6,17 @@ let p = if stdenv.is64bit then { arch = "x86_64"; gcclib = "${stdenv.gcc.gcc}/lib64"; - sha256 = "1fmmlvvh97d60n9k08bn4k6ghwr3yhs8sib82025nwpw1sq08vim"; + sha256 = "09kw7f0qsvx3vx1c1zb117yf3yk7kkz66agspz5xx9b0zh6i82jw"; } else { arch = "i386"; gcclib = "${stdenv.gcc.gcc}/lib"; - sha256 = "3940420bd9d1fe1ecec1a117bfd9d21d545bca59f5e0a4364304ab808c976f7f"; + sha256 = "0f2230c91120f05159281b39c620ab6bad6559ce8a17a0874d0a82350ebba426"; }; in stdenv.mkDerivation rec { - name = "yandex-disk-0.1.2.481"; + name = "yandex-disk-0.1.4.504"; src = fetchurl { url = "http://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${name}-1.fedora.${p.arch}.rpm"; -- cgit 1.4.1 From b37af08c3d60a17f19a1799033150fad7109601e Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 3 Sep 2014 21:54:15 +0400 Subject: Update mdbtools-git to latest --- pkgs/tools/misc/mdbtools/git.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgs/tools') diff --git a/pkgs/tools/misc/mdbtools/git.nix b/pkgs/tools/misc/mdbtools/git.nix index 2805514965e..b97af331093 100644 --- a/pkgs/tools/misc/mdbtools/git.nix +++ b/pkgs/tools/misc/mdbtools/git.nix @@ -3,12 +3,13 @@ scrollkeeper}: stdenv.mkDerivation { - name = "mdbtools-git"; + name = "mdbtools-git-2014-07-25"; src = fetchgit { url = "http://github.com/brianb/mdbtools.git"; - rev = "dfd752ec022097ee1e0999173aa604d8a0c0ca8b"; - sha256 = "0ibj36yxlhwjgi7cj170lwpbzdbgidkq5p8raa59v76bdrxwmb0n"; + rev = "9ab40e83e6789015c965c92bdb62f92f8cdd0dbd"; + sha256 = "18j1a9y9xhl7hhx30zvmx2n4w7dc8c7sdr6722sf3mh5230mvv59"; + name = "mdbtools-git-export"; }; buildInputs = [glib readline bison flex pkgconfig libiconv autoconf automake -- cgit 1.4.1 From 98778c4c2779d9e3c52003358a1978eb0bf0b2aa Mon Sep 17 00:00:00 2001 From: Jaka Hudoklin Date: Thu, 4 Sep 2014 01:30:04 +0200 Subject: Add JohnTheRipper, a fast password cracker --- pkgs/tools/security/john/default.nix | 28 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/tools/security/john/default.nix (limited to 'pkgs/tools') diff --git a/pkgs/tools/security/john/default.nix b/pkgs/tools/security/john/default.nix new file mode 100644 index 00000000000..97f67dfbd71 --- /dev/null +++ b/pkgs/tools/security/john/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchgit, openssl, nss, nspr, krb5, gmp, zlib, libpcap, re2 }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + name = "JohnTheRipper-${version}"; + version = "8a3e3c1d"; + buildInputs = [ openssl nss nspr krb5 gmp zlib libpcap re2 ]; + preConfigure = ''cd src''; + installPhase = '' + ensureDir $out/share/john/ + ensureDir $out/bin + cp -R ../run/* $out/share/john + ln -s $out/share/john/john $out/bin/john + ''; + src = fetchgit { + url = https://github.com/magnumripper/JohnTheRipper.git; + rev = "93f061bc41652c94ae049b52572aac709d18aa4c"; + sha256 = "1rnfi09830n34jcqaxmsam54p4zsq9a49ic2ljh44lahcipympvy"; + }; + meta = { + description = "John the Ripper password cracker"; + license = licenses.gpl2; + homepage = https://github.com/magnumripper/JohnTheRipper/; + maintainers = with maintainers; [offline]; + platforms = with platforms; unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4fe7a5cd355..e30d149c95e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1394,6 +1394,8 @@ let jnettop = callPackage ../tools/networking/jnettop { }; + john = callPackage ../tools/security/john { }; + jq = callPackage ../development/tools/jq {}; jscoverage = callPackage ../development/tools/misc/jscoverage { }; -- cgit 1.4.1