···42 # Get a console as soon as the initrd loads fbcon on EFI boot.
43 boot.initrd.kernelModules = [ "fbcon" ];
4400045 # Allow the user to log in as root without a password.
46 security.initialRootPassword = "";
47}
···42 # Get a console as soon as the initrd loads fbcon on EFI boot.
43 boot.initrd.kernelModules = [ "fbcon" ];
4445+ # Add support for cow filesystems and their utilities
46+ boot.supportedFilesystems = [ "zfs" "btrfs" ];
47+48 # Allow the user to log in as root without a password.
49 security.initialRootPassword = "";
50}
···11 # Provide wicd for easy wireless configuration.
12 #networking.wicd.enable = true;
1300014 # KDE complains if power management is disabled (to be precise, if
15 # there is no power management backend such as upower).
16 powerManagement.enable = true;
···27 AutoLoginUser=root
28 AutoLoginPass=""
29 '';
00000000000000000000000000000000000000000000000000000000000000000030}
···11 # Provide wicd for easy wireless configuration.
12 #networking.wicd.enable = true;
1314+ # Include gparted for partitioning disks
15+ environment.systemPackages = [ pkgs.gparted ];
16+17 # KDE complains if power management is disabled (to be precise, if
18 # there is no power management backend such as upower).
19 powerManagement.enable = true;
···30 AutoLoginUser=root
31 AutoLoginPass=""
32 '';
33+34+ # Custom kde-workspace adding some icons on the desktop
35+36+ system.activationScripts.installerDesktop = let
37+ openManual = pkgs.writeScript "nixos-manual.sh" ''
38+ #!${pkgs.stdenv.shell}
39+ cd ${config.system.build.manual.manual}/share/doc/nixos/
40+ konqueror ./index.html
41+ '';
42+43+ desktopFile = pkgs.writeText "nixos-manual.desktop" ''
44+ [Desktop Entry]
45+ Version=1.0
46+ Type=Application
47+ Name=NixOS Manual
48+ Exec=${openManual}
49+ Icon=konqueror
50+ '';
51+52+ in ''
53+ mkdir -p /root/Desktop
54+ ln -sfT ${desktopFile} /root/Desktop/nixos-manual.desktop
55+ ln -sfT ${pkgs.kde4.konsole}/share/applications/kde4/konsole.desktop /root/Desktop/konsole.desktop
56+ ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop /root/Desktop/gparted.desktop
57+ '';
58+59+ services.xserver.desktopManager.kde4.kdeWorkspacePackage = let
60+ pkg = pkgs.kde4.kde_workspace;
61+62+ plasmaInit = pkgs.writeText "00-defaultLayout.js" ''
63+ loadTemplate("org.kde.plasma-desktop.defaultPanel")
64+65+ for (var i = 0; i < screenCount; ++i) {
66+ var desktop = new Activity
67+ desktop.name = i18n("Desktop")
68+ desktop.screen = i
69+ desktop.wallpaperPlugin = 'image'
70+ desktop.wallpaperMode = 'SingleImage'
71+72+ var folderview = desktop.addWidget("folderview");
73+ folderview.writeConfig("url", "desktop:/");
74+75+ //Create more panels for other screens
76+ if (i > 0){
77+ var panel = new Panel
78+ panel.screen = i
79+ panel.location = 'bottom'
80+ panel.height = screenGeometry(i).height > 1024 ? 35 : 27
81+ var tasks = panel.addWidget("tasks")
82+ tasks.writeConfig("showOnlyCurrentScreen", true);
83+ }
84+ }
85+ '';
86+87+ in
88+ pkgs.stdenv.mkDerivation {
89+ inherit (pkg) name meta;
90+91+ buildCommand = ''
92+ mkdir -p $out
93+ cp -prf ${pkg}/* $out/
94+ chmod a+w $out/share/apps/plasma-desktop/init
95+ cp -f ${plasmaInit} $out/share/apps/plasma-desktop/init/00-defaultLayout.js
96+ '';
97+ };
98+99}
···1213 buildInputs = [ cmake pkgconfig libusb1 ];
1415- # Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
16- # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
17- # rules manually.
0018 postInstall = ''
19 mkdir -p "$out/etc/udev/rules.d/"
20 cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
000021 '';
2223 meta = with stdenv.lib; {
···1213 buildInputs = [ cmake pkgconfig libusb1 ];
1415+ # TODO: get these fixes upstream:
16+ # * Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
17+ # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
18+ # rules manually.
19+ # * Propagate libusb-1.0 dependency in pkg-config file.
20 postInstall = ''
21 mkdir -p "$out/etc/udev/rules.d/"
22 cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
23+24+ pcfile="$out"/lib/pkgconfig/librtlsdr.pc
25+ grep -q "Requires:" "$pcfile" && { echo "Upstream has added 'Requires:' in $(basename "$pcfile"); update nix expression."; exit 1; }
26+ echo "Requires: libusb-1.0" >> "$pcfile"
27 '';
2829 meta = with stdenv.lib; {
···23 '';
2425 configurePhase = ''
26- ./configure --prefix=$out --with-contrib-dir=${pkgs.stumpwmContrib}/contrib
27 '';
2829 installPhase = ''
30 make
31 make install
0000032 '';
3334 meta = with stdenv.lib; {
···23 '';
2425 configurePhase = ''
26+ ./configure --prefix=$out --with-contrib-dir=${stumpwmContrib}/contrib
27 '';
2829 installPhase = ''
30 make
31 make install
32+ # For some reason, stumpwmContrib is not retained as a runtime
33+ # dependency (probably because $out/bin/stumpwm is compressed or
34+ # obfuscated in some way). Thus we add an explicit reference here.
35+ mkdir $out/nix-support
36+ echo ${stumpwmContrib} > $out/nix-support/stumpwm-contrib
37 '';
3839 meta = with stdenv.lib; {
···1+# Fetches a chicken egg from henrietta using `chicken-install -r'
2+# See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html
3+4+{ stdenv, chicken }:
5+{ name, version, md5 ? "", sha256 ? "" }:
6+7+stdenv.mkDerivation {
8+ name = "chicken-${name}-export";
9+ builder = ./builder.sh;
10+ buildInputs = [ chicken ];
11+12+ outputHashAlgo = if sha256 == "" then "md5" else "sha256";
13+ outputHashMode = "recursive";
14+ outputHash = if sha256 == "" then md5 else sha256;
15+16+ inherit version;
17+18+ eggName = name;
19+20+ impureEnvVars = [
21+ # We borrow these environment variables from the caller to allow
22+ # easy proxy configuration. This is impure, but a fixed-output
23+ # derivation like fetchurl is allowed to do so since its result is
24+ # by definition pure.
25+ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"
26+ ];
27+}
28+
···1+{ stdenv, fetchgit, ocaml, findlib, menhir, which }:
2+3+let inherit (stdenv.lib) getVersion versionAtLeast; in
4+5+assert versionAtLeast (getVersion ocaml) "3.12";
6+7+stdenv.mkDerivation {
8+9+ name = "eff-20140928";
10+11+ src = fetchgit {
12+ url = "https://github.com/matijapretnar/eff.git";
13+ rev = "90f884a790fddddb51d4d1d3b7c2edf1e8aabb64";
14+ sha256 = "28e389b35e6959072c245c2e79fe305885b1b2d44ff540a02a097e09e9f9698f";
15+ };
16+17+ buildInputs = [ ocaml findlib menhir which ];
18+19+ doCheck = true;
20+ checkTarget = "test";
21+22+ meta = with stdenv.lib; {
23+ homepage = "http://www.eff-lang.org";
24+ description = "A functional programming language based on algebraic effects and their handlers";
25+ longDescription = ''
26+ Eff is a functional language with handlers of not only exceptions,
27+ but also of other computational effects such as state or I/O. With
28+ handlers, you can simply implement transactions, redirections,
29+ backtracking, multi-threading, and much more...
30+ '';
31+ license = licenses.bsd2;
32+ platforms = ocaml.meta.platforms;
33+ maintainers = [ maintainers.jirkamarsik ];
34+ };
35+}
···4849 enableParallelBuilding = true;
5051+ # Fix a build failure on systems with nix store optimisation.
52+ # (The build process attempted to copy file a overwriting file b, where a and
53+ # b are hard-linked, which results in cp returning a non-zero exit code.)
54+ # https://github.com/NixOS/nixpkgs/issues/4266
55+ postUnpack = ''rm "$sourceRoot/enc/unicode/name2ctype.h"'';
56+57 patches = [
58 ./ruby19-parallel-install.patch
59 ./bitperfect-rdoc.patch
···1# This file was auto-generated by cabal2nix. Please do NOT edit manually!
23-{ cabal, byteable, cipherAes, cryptoRandom, random }:
45cabal.mkDerivation (self: {
6 pname = "cprng-aes";
7- version = "0.5.2";
8- sha256 = "1nf8dd83ywriq2ynv48f2s5lvc9s3srq4j5vbspmf0kc74kmq2pf";
9- buildDepends = [ byteable cipherAes cryptoRandom random ];
10 meta = {
11 homepage = "http://github.com/vincenthz/hs-cprng-aes";
12 description = "Crypto Pseudo Random Number Generator using AES in counter mode";
···1# This file was auto-generated by cabal2nix. Please do NOT edit manually!
23+{ cabal, byteable, cipherAes, cryptoRandom }:
45cabal.mkDerivation (self: {
6 pname = "cprng-aes";
7+ version = "0.6.0";
8+ sha256 = "0d6m6mjkwvkg1cqq3q3hc64hp445kbcdf12lwm6k2scrpd2r7bhq";
9+ buildDepends = [ byteable cipherAes cryptoRandom ];
10 meta = {
11 homepage = "http://github.com/vincenthz/hs-cprng-aes";
12 description = "Crypto Pseudo Random Number Generator using AES in counter mode";
···1011 nativeBuildInputs = [ flex bison ];
1213+ # We need to force the autodetection because detection doesn't
14+ # work in pure build enviroments.
15+ configureFlags =
16+ if stdenv.isLinux then [ "--with-pcap=linux" ]
17+ else if stdenv.isDarwin then [ "--with-pcap=bpf" ]
18+ else [];
1920 preInstall = ''mkdir -p $out/bin'';
21
···5#TODO: share most stuff between python and non-python builds, perhaps via multiple-output
67let
8- version = "2.9.1";
9in
1011stdenv.mkDerivation (rec {
···1314 src = fetchurl {
15 url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
16- sha256 = "1nqgd1qqmg0cg09mch78m2ac9klj9n87blilx4kymi7jcv5n8g7x";
17 };
1819 buildInputs = stdenv.lib.optional pythonSupport python
···5#TODO: share most stuff between python and non-python builds, perhaps via multiple-output
67let
8+ version = "2.9.2";
9in
1011stdenv.mkDerivation (rec {
···1314 src = fetchurl {
15 url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
16+ sha256 = "1g6mf03xcabmk5ing1lwqmasr803616gb2xhn7pll10x2l5w6y2i";
17 };
1819 buildInputs = stdenv.lib.optional pythonSupport python
-8
pkgs/development/libraries/libxml2/setup-hook.sh
···11if test -z "$libxmlHookDone"; then
12 libxmlHookDone=1
1314- # Set http_proxy and ftp_proxy to an invalid host to prevent
15- # xmllint and xsltproc from trying to download DTDs from the
16- # network even when --nonet is not given. That would be impure.
17- # (Note that .invalid is a reserved domain guaranteed not to
18- # work.)
19- export http_proxy=http://nodtd.invalid/
20- export ftp_proxy=http://nodtd.invalid/
21-22 # Set up XML_CATALOG_FILES. An empty initial value prevents
23 # xmllint and xsltproc from looking in /etc/xml/catalog.
24 export XML_CATALOG_FILES
···11if test -z "$libxmlHookDone"; then
12 libxmlHookDone=1
130000000014 # Set up XML_CATALOG_FILES. An empty initial value prevents
15 # xmllint and xsltproc from looking in /etc/xml/catalog.
16 export XML_CATALOG_FILES
···1{ stdenv, fetchurl }:
23stdenv.mkDerivation rec {
4- name = "npth-0.91";
56 src = fetchurl {
7 url = "ftp://ftp.gnupg.org/gcrypt/npth/${name}.tar.bz2";
8- sha256 = "1qgs1n70x83dyyysabg50dh8s3464jwsa63qi5if2cd3sk78dvya";
9 };
1011- meta = {
12 description = "The New GNU Portable Threads Library";
13 longDescription = ''
14 This is a library to provide the GNU Pth API and thus a non-preemptive
···20 that this is a solid way to provide a co-routine based framework.
21 '';
22 homepage = http://www.gnupg.org;
23- license = stdenv.lib.licenses.lgpl3;
24- platforms = stdenv.lib.platforms.all;
25 };
26}
···1{ stdenv, fetchurl }:
23stdenv.mkDerivation rec {
4+ name = "npth-1.0";
56 src = fetchurl {
7 url = "ftp://ftp.gnupg.org/gcrypt/npth/${name}.tar.bz2";
8+ sha256 = "0vppr13821bkdv8348067l1aj3sb0n0rbmnsgymzy3iifvirvm4s";
9 };
1011+ meta = with stdenv.lib; {
12 description = "The New GNU Portable Threads Library";
13 longDescription = ''
14 This is a library to provide the GNU Pth API and thus a non-preemptive
···20 that this is a solid way to provide a co-routine based framework.
21 '';
22 homepage = http://www.gnupg.org;
23+ license = licenses.lgpl3;
24+ platforms = platforms.all;
25 };
26}
···1+{ stdenv, fetchurl, ocaml, findlib }:
2+3+stdenv.mkDerivation {
4+5+ name = "ansiterminal-0.6.5";
6+7+ src = fetchurl {
8+ url = "https://forge.ocamlcore.org/frs/download.php/1206/ANSITerminal-0.6.5.tar.gz";
9+ sha256 = "1j9kflv2i16vf9hy031cl6z8hv6791mjbhnd9bw07y1pswdlx1r6";
10+ };
11+12+ buildInputs = [ ocaml findlib ];
13+14+ configurePhase = "ocaml setup.ml -configure --prefix $out";
15+16+ buildPhase = "ocaml setup.ml -build";
17+18+ installPhase = "ocaml setup.ml -install";
19+20+ createFindlibDestdir = true;
21+22+ meta = with stdenv.lib; {
23+ homepage = "https://forge.ocamlcore.org/projects/ansiterminal";
24+ description = "A module allowing to use the colors and cursor movements on ANSI terminals";
25+ longDescription = ''
26+ ANSITerminal is a module allowing to use the colors and cursor
27+ movements on ANSI terminals. It also works on the windows shell (but
28+ this part is currently work in progress).
29+ '';
30+ license = licenses.lgpl3;
31+ platforms = ocaml.meta.platforms;
32+ maintainers = [ maintainers.jirkamarsik ];
33+ };
34+}
+41
pkgs/development/ocaml-modules/bolt/default.nix
···00000000000000000000000000000000000000000
···1+{ stdenv, fetchurl, ocaml, findlib, which }:
2+3+let inherit (stdenv.lib) getVersion versionAtLeast; in
4+5+assert versionAtLeast (getVersion ocaml) "4.00.0";
6+assert versionAtLeast (getVersion findlib) "1.3.3";
7+8+stdenv.mkDerivation rec {
9+10+ name = "bolt-1.4";
11+12+ src = fetchurl {
13+ url = "https://forge.ocamlcore.org/frs/download.php/1043/${name}.tar.gz";
14+ sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
15+ };
16+17+ buildInputs = [ ocaml findlib which ];
18+19+ # The custom `configure` script does not expect the --prefix
20+ # option. Installation is handled by ocamlfind.
21+ dontAddPrefix = true;
22+23+ createFindlibDestdir = true;
24+25+ buildFlags = "all";
26+27+ doCheck = true;
28+ checkTarget = "tests";
29+30+ meta = with stdenv.lib; {
31+ homepage = "http://bolt.x9c.fr";
32+ description = "A logging tool for the OCaml language";
33+ longDescription = ''
34+ Bolt is a logging tool for the OCaml language. It is inspired by and
35+ modeled after the famous log4j logging framework for Java.
36+ '';
37+ license = licenses.lgpl3;
38+ platforms = ocaml.meta.platforms;
39+ maintainers = [ maintainers.jirkamarsik ];
40+ };
41+}
···1+{ stdenv, fetchurl, ocaml, findlib, ncurses }:
2+3+stdenv.mkDerivation {
4+5+ name = "ocp-build-1.99.8-beta";
6+7+ src = fetchurl {
8+ url = "https://github.com/OCamlPro/ocp-build/archive/ocp-build.1.99.8-beta.tar.gz";
9+ sha256 = "06qh8v7k5m52xbivas08lblspsnvdl0vd7ghfj6wvpnfl8qvqabn";
10+ };
11+12+ buildInputs = [ ocaml findlib ncurses ];
13+14+ patches = [ ./fix-for-no-term.patch ];
15+16+ # In the Nix sandbox, the TERM variable is unset and stty does not
17+ # work. In such a case, ocp-build crashes due to a bug. The
18+ # ./fix-for-no-term.patch fixes this bug in the source code and hence
19+ # also in the final installed version of ocp-build. However, it does not
20+ # fix the bug in the precompiled bootstrap version of ocp-build that is
21+ # used during the compilation process. In order to bypass the bug until
22+ # it's also fixed upstream, we simply set TERM to some valid entry in the
23+ # terminfo database during the bootstrap.
24+ TERM = "xterm";
25+26+ meta = with stdenv.lib; {
27+ homepage = "http://typerex.ocamlpro.com/ocp-build.html";
28+ description = "A build tool for OCaml";
29+ longDescription = ''
30+ ocp-build is a build system for OCaml application, based on simple
31+ descriptions of packages. ocp-build combines the descriptions of
32+ packages, and optimize the parallel compilation of files depending on
33+ the number of cores and the automatically-infered dependencies
34+ between source files.
35+ '';
36+ license = licenses.gpl3;
37+ platforms = ocaml.meta.platforms;
38+ maintainers = [ maintainers.jirkamarsik ];
39+ };
40+}
···1+{ stdenv, fetchurl, ocaml, findlib, ocpBuild, opam, cmdliner }:
2+3+let inherit (stdenv.lib) getVersion versionAtLeast; in
4+5+assert versionAtLeast (getVersion ocaml) "3.12.1";
6+assert versionAtLeast (getVersion ocpBuild) "1.99.3-beta";
7+8+stdenv.mkDerivation {
9+10+ name = "ocp-indent-1.4.2b";
11+12+ src = fetchurl {
13+ url = "https://github.com/OCamlPro/ocp-indent/archive/1.4.2b.tar.gz";
14+ sha256 = "1p0n2zcl5kf543x2xlqrz1aa51f0dqal8l392sa41j6wx82j0gpb";
15+ };
16+17+ buildInputs = [ ocaml findlib ocpBuild opam cmdliner ];
18+19+ createFindlibDestdir = true;
20+21+ # The supplied installer uses opam-installer which breaks when run
22+ # normally since it tries to `mkdir $HOME`. However, we can use
23+ # `opam-installer --script` to get the shell script that performs only
24+ # the installation and just run that. Furthermore, we do the same that is
25+ # done by pkgs/development/ocaml-modules/react and rename the paths meant
26+ # for opam-installer so that they are in line with the other OCaml
27+ # libraries in Nixpkgs.
28+ installPhase = ''
29+ opam-installer --script --prefix=$out ocp-indent.install \
30+ | sed s!lib/ocp-indent!lib/ocaml/${getVersion ocaml}/site-lib/ocp-indent! \
31+ | sh
32+ '';
33+34+ meta = with stdenv.lib; {
35+ homepage = "http://typerex.ocamlpro.com/ocp-indent.html";
36+ description = "A customizable tool to indent OCaml code";
37+ license = licenses.gpl3;
38+ platforms = ocaml.meta.platforms;
39+ maintainers = [ maintainers.jirkamarsik ];
40+ };
41+}
+29
pkgs/development/tools/parsing/hammer/default.nix
···00000000000000000000000000000
···1+{ stdenv, fetchgit, glib, pkgconfig, python, scons, pythonPackages }:
2+3+stdenv.mkDerivation rec {
4+ name = "hammer-${version}";
5+ version = "e7aa734";
6+7+ src = fetchgit {
8+ url = "git://github.com/UpstandingHackers/hammer";
9+ sha256 = "1v8f2a6bgjgdkhbqz751bqjlwb9lmqn5x63xcskwcl2b9n36vqi9";
10+ rev = "e7aa73446e23f4af2fce5f88572aae848f212c16";
11+ };
12+13+ buildInputs = [ glib pkgconfig python scons ];
14+ buildPhase = "scons prefix=$out";
15+ installPhase = "scons prefix=$out install";
16+17+ meta = with stdenv.lib; {
18+ description = "Hammer is a parsing library";
19+ longDescription = "Hammer is a parsing library. Like many modern parsing libraries,
20+ it provides a parser combinator interface for writing grammars
21+ as inline domain-specific languages, but Hammer also provides a
22+ variety of parsing backends. It's also bit-oriented rather than
23+ character-oriented, making it ideal for parsing binary data such
24+ as images, network packets, audio, and executables.";
25+ homepage = https://github.com/UpstandingHackers/hammer;
26+ license = licenses.gpl2;
27+ platforms = platforms.linux;
28+ };
29+}
···1+{ stdenv, fetchurl, pythonPackages, lilypond, pyqt4 }:
2+3+pythonPackages.buildPythonPackage rec {
4+ name = "frescobaldi-${version}";
5+ version = "2.0.16";
6+7+ src = fetchurl {
8+ url = "https://github.com/wbsoft/frescobaldi/releases/download/"
9+ + "v2.0.16/${name}.tar.gz";
10+ sha256 = "12pabvq5b2lq84q3kx8lh02zh6ali6v4wnin2k2ycnm45mk9ms6q";
11+ };
12+13+ propagatedBuildInputs = with pythonPackages; [ lilypond
14+ pyqt4 poppler-qt4 ];
15+16+ patches = [ ./setup.cfg.patch ./python-path.patch ];
17+18+ meta = with stdenv.lib; {
19+ homepage = http://frescobaldi.org/;
20+ description = ''Frescobaldi is a LilyPond sheet music text editor'';
21+ longDescription = ''
22+ Powerful text editor with syntax highlighting and automatic completion,
23+ Music view with advanced Point & Click, Midi player to proof-listen
24+ LilyPond-generated MIDI files, Midi capturing to enter music,
25+ Powerful Score Wizard to quickly setup a music score, Snippet Manager
26+ to store and apply text snippets, templates or scripts, Use multiple
27+ versions of LilyPond, automatically selects the correct version, Built-in
28+ LilyPond documentation browser and built-in User Guide, Smart
29+ layout-control functions like coloring specific objects in the PDF,
30+ MusicXML import, Modern user iterface with configurable colors,
31+ fonts and keyboard shortcuts
32+ '';
33+ license = licenses.gpl2Plus;
34+ maintainers = [ maintainers.sepi ];
35+ platforms = platforms.all;
36+ };
37+}
···1+#!/usr/bin/env bash
2+set -e
3+4+# Get the latest versions from kernel.org
5+LINUXSED='s/.*linux-\([0-9]\+\(.[0-9]\+\)*\).*/\1/p'
6+KDATA="$(curl -s https://www.kernel.org | sed -n -e '/Download complete/p')"
7+VERSIONS=($(sed -n -e $LINUXSED <<< "$KDATA" | sort -Vr))
8+9+# Remove mainline version if there is a stable update
10+# Note due to sorting these two will always exist at the bottom
11+if grep -q "^${VERSIONS[1]}" <<< "${VERSIONS[0]}"; then
12+ VERSIONS=(${VERSIONS[@]:0:1} ${VERSIONS[@]:2})
13+fi
14+15+# Inspect each file and see if it has the latest version
16+NIXPKGS="$(git rev-parse --show-toplevel)"
17+ls $NIXPKGS/pkgs/os-specific/linux/kernel | while read FILE; do
18+ KERNEL="$(sed -n $LINUXSED <<< "$FILE")"
19+ [ -z "$KERNEL" ] && continue
20+21+ # Find the matching new kernel version
22+ MATCHING=""
23+ for V in "${VERSIONS[@]}"; do
24+ if grep -q "^$KERNEL" <<< "$V"; then
25+ MATCHING="$V"
26+ break
27+ fi
28+ done
29+ if [ -z "$MATCHING" ]; then
30+ echo "Out-of-support $KERNEL"
31+ continue
32+ fi
33+34+ # Inspect the nix expression to check for changes
35+ DATA="$(<$NIXPKGS/pkgs/os-specific/linux/kernel/$FILE)"
36+ URL="$(sed -n -e 's/.*url = "\(.*\)";.*/\1/p' <<< "$DATA" | sed -e "s/\${version}/$MATCHING/g")"
37+ OLDVER=$(sed -n -e 's/.*version = "\(.*\)".*/\1/p' <<< "$DATA")
38+ if [ "$OLDVER" = "$V" ]; then
39+ echo "No updates for $KERNEL"
40+ continue
41+ fi
42+43+ # Download the new file for the hash
44+ if ! HASH="$(nix-prefetch-url $URL 2>/dev/null)"; then
45+ echo "Failed to get hash of $URL"
46+ continue
47+ fi
48+ sed -i "s/sha256 = \".*\"/sha256 = \"$HASH\"/g" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
49+50+ # Rewrite the expression
51+ sed -i -e '/version = /d' -e '/modDirVersion = /d' $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
52+ if grep -q '^[0-9]\+.[0-9]\+$' <<< "$V"; then
53+ sed -i "\#import ./generic.nix (args // rec {#a \ modDirVersion = \"${V}.0\";" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
54+ fi
55+ sed -i "\#import ./generic.nix (args // rec {#a \ version = \"$V\";" $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
56+57+ # Commit the changes
58+ git add -u $NIXPKGS/pkgs/os-specific/linux/kernel/$FILE
59+ git commit -m "kernel: $OLDVER -> $V" >/dev/null 2>&1
60+61+ echo "Updated $OLDVER -> $V"
62+done
···9if test -z "$sgmlHookDone"; then
10 sgmlHookDone=1
1112- # Set http_proxy and ftp_proxy to a invalid host to prevent
13- # xmllint and xsltproc from trying to download DTDs from the
14- # network even when --nonet is not given. That would be impure.
15- # (Note that .invalid is a reserved domain guaranteed not to
16- # work.)
17- export http_proxy=http://nodtd.invalid/
18- export ftp_proxy=http://nodtd.invalid/
19-20 export SGML_CATALOG_FILES
21 envHooks+=(addSGMLCatalogs)
22fi
···9if test -z "$sgmlHookDone"; then
10 sgmlHookDone=1
110000000012 export SGML_CATALOG_FILES
13 envHooks+=(addSGMLCatalogs)
14fi