about summary refs log tree commit diff
path: root/machines
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-02-14 18:51:28 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-02-14 19:06:15 +0100
commit01228bbe176aa7571e929ca5bab3f03227509529 (patch)
tree92b9cf3d8b69eebfea963df162e7cd34697f3ddb /machines
parent643a9f4589a33f8dc20476925bb922dbee905a7d (diff)
tishtushi: Really use the latest mainline kernel.
I can't emphasize this enough: *REALLY*

Whenever the newest stable kernel is released, the version in
linux_testing will *still* the latest -rc even though it's older than
the current stable.

Strictly speaking, it's true that even though the stable version is
newer, the label "testing" is correct. However, and in my case I want to
really have the latest mainline version, no matter whether it's stable
or testing.

So, we're just comparing the major and minor version numbers and if they
match, we're using the latest stable, otherwise we're using testing.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'machines')
-rw-r--r--machines/tishtushi.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/machines/tishtushi.nix b/machines/tishtushi.nix
index d4e2a0c9..3e067ca9 100644
--- a/machines/tishtushi.nix
+++ b/machines/tishtushi.nix
@@ -11,9 +11,11 @@ in {
   imports = singleton ../common-workstation.nix;
 
   boot = rec {
-    kernelPackages = let
-      origKernel = pkgs.linux_testing;
-      bfqsched = pkgs.vuizvuiKernelPatches.bfqsched // {
+    kernelPackages = with pkgs; let
+      trimVer = ver: take 2 (splitString "." (replaceChars ["-"] ["."] ver));
+      tooOld = trimVer linux_latest.version == trimVer linux_testing.version;
+      origKernel = if tooOld then linux_latest else linux_testing;
+      bfqsched = vuizvuiKernelPatches.bfqsched // {
         extraConfig = ''
           IOSCHED_BFQ y
           CGROUP_BFQIO y
@@ -25,7 +27,7 @@ in {
       kernel = origKernel.override {
         kernelPatches = origKernel.kernelPatches ++ singleton bfqsched;
       };
-    in pkgs.linuxPackagesFor kernel kernelPackages;
+    in linuxPackagesFor kernel kernelPackages;
 
     initrd.kernelModules = [ "fbcon" "usb_storage" ];
     loader.grub.device = "/dev/disk/by-id/${diskID}";