feat: add boot nixos module
This commit is contained in:
parent
e8445e20ad
commit
f7ca351f48
48
modules/nixos/boot/default.nix
Normal file
48
modules/nixos/boot/default.nix
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkDefault mkEnableOption mkIf;
|
||||||
|
|
||||||
|
cfg = config.ataraxia.defaults.boot;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.ataraxia.defaults.boot = {
|
||||||
|
enable = mkEnableOption "Default boot settings";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
timeout = mkDefault 4;
|
||||||
|
systemd-boot.enable = mkDefault false;
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelParams = [
|
||||||
|
"kvm.ignore_msrs=1"
|
||||||
|
"kvm.report_ignored_msrs=0"
|
||||||
|
"nofb"
|
||||||
|
"rd.systemd.show_status=auto"
|
||||||
|
"rd.udev.log_priority=3"
|
||||||
|
"zswap.enabled=0"
|
||||||
|
];
|
||||||
|
|
||||||
|
kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
||||||
|
|
||||||
|
consoleLogLevel = 3;
|
||||||
|
|
||||||
|
kernel.sysctl = mkIf config.zramSwap.enable {
|
||||||
|
"vm.swappiness" = 100;
|
||||||
|
# "vm.vfs_cache_pressure" = 500;
|
||||||
|
# "vm.dirty_background_ratio" = 1;
|
||||||
|
# "vm.dirty_ratio" = 50;
|
||||||
|
# "vm.page-cluster" = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
tmp.cleanOnBoot = !config.boot.tmp.useTmpfs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
@ -33,6 +33,7 @@ in
|
|||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
baseRole = {
|
baseRole = {
|
||||||
|
ataraxia.defaults.boot.enable = mkDefault true;
|
||||||
ataraxia.defaults.hardware.enable = mkDefault true;
|
ataraxia.defaults.hardware.enable = mkDefault true;
|
||||||
ataraxia.defaults.locale.enable = mkDefault true;
|
ataraxia.defaults.locale.enable = mkDefault true;
|
||||||
ataraxia.defaults.lix.enable = mkDefault true;
|
ataraxia.defaults.lix.enable = mkDefault true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user