refactor: Fleet and sw behind mkIf guards
This commit is contained in:
@@ -5,44 +5,60 @@
|
||||
# - Bootloader configuration (systemd-boot with Plymouth)
|
||||
# - Timezone and locale settings
|
||||
# - Systemd sleep configuration
|
||||
#
|
||||
# Only applies to:
|
||||
# - Linux systems (not Darwin/macOS)
|
||||
# - Systems with actual boot hardware (not containers/WSL)
|
||||
|
||||
{ lib, ... }:
|
||||
{
|
||||
boot = {
|
||||
loader.systemd-boot.enable = lib.mkDefault true;
|
||||
loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
plymouth.enable = lib.mkDefault true;
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
# Enable "Silent boot"
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
let
|
||||
# Check if this is a bootable system (not container, not WSL)
|
||||
isBootable = !(config.boot.isContainer or false) && (pkgs.stdenv.isLinux);
|
||||
in
|
||||
{
|
||||
config = lib.mkIf isBootable {
|
||||
boot = {
|
||||
loader.systemd-boot.enable = lib.mkDefault true;
|
||||
loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
plymouth.enable = lib.mkDefault true;
|
||||
|
||||
# Hide the OS choice for bootloaders.
|
||||
# It's still possible to open the bootloader list by pressing any key
|
||||
# It will just not appear on screen unless a key is pressed
|
||||
loader.timeout = lib.mkDefault 0;
|
||||
# Enable "Silent boot"
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
|
||||
# Hide the OS choice for bootloaders.
|
||||
# It's still possible to open the bootloader list by pressing any key
|
||||
# It will just not appear on screen unless a key is pressed
|
||||
loader.timeout = lib.mkDefault 0;
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
systemd.sleep.extraConfig = ''
|
||||
SuspendState=freeze
|
||||
HibernateDelaySec=2h
|
||||
'';
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/New_York";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
systemd.sleep.extraConfig = ''
|
||||
SuspendState=freeze
|
||||
HibernateDelaySec=2h
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user