about summary refs log tree commit diff
path: root/modules/system
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-07-20 00:02:00 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-07-20 00:02:00 +0200
commit48a9c6db6d985ebff7c00676c29ad50d7d1cee6c (patch)
tree1233f8c7881492b8de7b9bddb39c3e2a3fc19604 /modules/system
parent09b1cee2f722defa1ba8a0543ca0a9238b99d0d4 (diff)
Introduce new system.kernel.useBleedingEdge option
This dissolves the user.aszlig.system.kernel module, which was not only
to stay on the latest bleeding edge kernel but also to enable BFQ. The
latter has been factored out already a while ago already.

Originally, I had a fully custom kernel config for mmrnmhrm and dnyarri,
but it's no longer the case and thus the user.aszlig.system.kernel
module is now no longer needed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/kernel/rckernel.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/system/kernel/rckernel.nix b/modules/system/kernel/rckernel.nix
new file mode 100644
index 00000000..a3ccf907
--- /dev/null
+++ b/modules/system/kernel/rckernel.nix
@@ -0,0 +1,23 @@
+{ config, pkgs, lib, ... }:
+
+{
+  options.vuizvui.system.kernel.useBleedingEdge = lib.mkOption {
+    type = lib.types.bool;
+    default = false;
+    description = ''
+      Whether to always use the latest kernel, even if it's still a release
+      canidate version.
+    '';
+  };
+
+  config = lib.mkIf config.vuizvui.system.kernel.useBleedingEdge {
+    boot.kernelPackages = let
+      inherit (lib) take splitString replaceStrings;
+      inherit (pkgs) linux_latest linux_testing;
+      dotizeVer = replaceStrings ["-"] ["."];
+      trimVer = ver: take 2 (splitString "." (dotizeVer ver));
+      tooOld = trimVer linux_latest.version == trimVer linux_testing.version;
+      kernel = if tooOld then linux_latest else linux_testing;
+    in pkgs.linuxPackagesFor kernel;
+  };
+}