nixos-config/modules/common/linux.nix

59 lines
1.1 KiB
Nix
Raw Normal View History

2024-04-11 20:15:47 +02:00
{
lib,
config,
pkgs,
...
}:
with lib;
{
options.useLatestKernel = mkOption {
type = types.bool;
default = false;
example = true;
description = ''
Whether or not to use the latest Linux kernel version.
'';
};
options.consoleFont = mkOption {
type = types.str;
default = "Lat2-Terminus16";
description = ''
The font to use in the Linux console.
'';
};
options.timeZone = mkOption {
type = types.str;
default = "Europe/Paris";
description = ''
The system time zone.
'';
};
options.locale = mkOption {
type = types.str;
default = "en_US.utf8";
description = ''
The system locale.
'';
};
options.keymap = mkOption {
type = types.str;
default = "fr";
example = "fr";
description = ''
The keyboard map used.
'';
};
config = {
boot.kernelPackages = mkIf config.useLatestKernel pkgs.linuxPackages_latest;
time.timeZone = config.timeZone;
console.font = config.consoleFont;
console.keyMap = config.keymap;
i18n.defaultLocale = config.locale;
};
}