Skip to content

Commit 0b85835

Browse files
authored
Update boot.nix
1 parent c3ef463 commit 0b85835

1 file changed

Lines changed: 70 additions & 52 deletions

File tree

modules/default/boot.nix

Lines changed: 70 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,77 @@
1-
config = lib.mkIf config.glf.boot.enable {
2-
nixpkgs.overlays = [
3-
(self: super: {
4-
linuxPackages = super.linuxPackages // {
5-
kernel = super.linuxPackages.kernel.override {
6-
structuredExtraConfig = with lib.kernel; {
7-
HZ_1000 = yes;
8-
HZ = 1000;
9-
PREEMPT_FULL = yes;
10-
IOSCHED_BFQ = yes;
11-
DEFAULT_BFQ = yes;
12-
DEFAULT_IOSCHED = "bfq";
13-
V4L2_LOOPBACK = module;
14-
HID = yes;
1+
{
2+
lib,
3+
config,
4+
pkgs,
5+
pkgs-unstable,
6+
...
7+
}:
8+
let
9+
plymouth-glfos = pkgs.callPackage ../../pkgs/plymouth-glfos {};
10+
in
11+
{
12+
options.glf.boot.enable = lib.mkOption {
13+
description = "Enable GLF Boot configurations";
14+
type = lib.types.bool;
15+
default = true;
16+
};
17+
18+
config = lib.mkIf config.glf.boot.enable {
19+
nixpkgs.overlays = [
20+
(self: super: {
21+
linuxPackages = super.linuxPackages // {
22+
kernel = super.linuxPackages.kernel.override {
23+
structuredExtraConfig = with lib.kernel; {
24+
HZ_1000 = yes;
25+
HZ = 1000;
26+
PREEMPT_FULL = yes;
27+
IOSCHED_BFQ = yes;
28+
DEFAULT_BFQ = yes;
29+
DEFAULT_IOSCHED = "bfq";
30+
V4L2_LOOPBACK = module;
31+
HID = yes;
32+
};
1533
};
1634
};
17-
};
18-
})
19-
];
35+
})
36+
];
2037

21-
services.udev.extraRules = ''
22-
ACTION=="add|change", SUBSYSTEM=="block", ATTR{queue/scheduler}="bfq"
23-
'';
38+
services.udev.extraRules = ''
39+
ACTION=="add|change", SUBSYSTEM=="block", ATTR{queue/scheduler}="bfq"
40+
'';
2441

25-
boot.loader.grub.splashImage = ../../assets/wallpaper/dark.jpg;
26-
boot.loader.grub.default = "saved";
27-
boot = {
28-
kernelPackages = pkgs-unstable.linuxPackages_latest;
29-
tmp.cleanOnBoot = true;
30-
supportedFilesystems.zfs = lib.mkForce false;
31-
kernelParams =
32-
if builtins.elem "kvm-amd" config.boot.kernelModules then [ "amd_pstate=active" "nosplit_lock_mitigate" "clearcpuid=514" ] else [ "nosplit_lock_mitigate" ];
33-
plymouth = {
34-
enable = true;
35-
theme = "glfos";
36-
themePackages = [ plymouth-glfos ];
37-
};
38-
kernel.sysctl = {
39-
"kernel.split_lock_mitigate" = 0;
40-
vm_swappiness = 10;
41-
vm_vfs_cache_pressure = 50;
42-
vm_dirty_bytes = 268435456;
43-
"vm.max_map_count" = 16777216;
44-
vm_dirty_background_bytes = 67108864;
45-
vm_dirty_writeback_centisecs = 1500;
46-
kernel_nmi_watchdog = 0;
47-
kernel_unprivileged_userns_clone = 1;
48-
kernel_printk = "3 3 3 3";
49-
kernel_kptr_restrict = 2;
50-
kernel_kexec_load_disabled = 1;
42+
boot.loader.grub.splashImage = ../../assets/wallpaper/dark.jpg;
43+
boot.loader.grub.default = "saved";
44+
boot = {
45+
kernelPackages = pkgs-unstable.linuxPackages_latest;
46+
tmp.cleanOnBoot = true;
47+
supportedFilesystems.zfs = lib.mkForce false;
48+
kernelParams =
49+
if builtins.elem "kvm-amd" config.boot.kernelModules then [ "amd_pstate=active" "nosplit_lock_mitigate" "clearcpuid=514" ] else [ "nosplit_lock_mitigate" ];
50+
plymouth = {
51+
enable = true;
52+
theme = "glfos";
53+
themePackages = [ plymouth-glfos ];
54+
};
55+
kernel.sysctl = {
56+
"kernel.split_lock_mitigate" = 0;
57+
vm_swappiness = 10;
58+
vm_vfs_cache_pressure = 50;
59+
vm_dirty_bytes = 268435456;
60+
"vm.max_map_count" = 16777216;
61+
vm_dirty_background_bytes = 67108864;
62+
vm_dirty_writeback_centisecs = 1500;
63+
kernel_nmi_watchdog = 0;
64+
kernel_unprivileged_userns_clone = 1;
65+
kernel_printk = "3 3 3 3";
66+
kernel_kptr_restrict = 2;
67+
kernel_kexec_load_disabled = 1;
68+
};
5169
};
52-
};
5370

54-
hardware.graphics = {
55-
enable = true;
56-
package = pkgs-unstable.mesa;
57-
package32 = pkgs-unstable.pkgsi686Linux.mesa;
71+
hardware.graphics = {
72+
enable = true;
73+
package = pkgs-unstable.mesa;
74+
package32 = pkgs-unstable.pkgsi686Linux.mesa;
75+
};
5876
};
59-
};
77+
}

0 commit comments

Comments
 (0)