mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-17 20:52:09 -08:00
refactor: configure more core system options via liminalOS module
Some checks are pending
Check flake / check (push) Waiting to run
Some checks are pending
Check flake / check (push) Waiting to run
This commit is contained in:
parent
104a61a055
commit
1aa376e94f
5 changed files with 144 additions and 123 deletions
|
@ -14,6 +14,8 @@
|
|||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
networking.hostName = "demeter"; # Define your hostname.
|
||||
|
||||
liminalOS = {
|
||||
flakeLocation = "/home/youwen/.config/liminalOS";
|
||||
config.allowUnfree = true;
|
||||
|
@ -42,87 +44,35 @@
|
|||
programs.flatpak.enable = true;
|
||||
};
|
||||
|
||||
# Bootloader.
|
||||
boot.loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 15;
|
||||
# Lanzaboote currently replaces the systemd-boot module.
|
||||
# This setting is usually set to true in configuration.nix
|
||||
# generated at installation time. So we force it to false
|
||||
# for now.
|
||||
systemd-boot = {
|
||||
enable = false;
|
||||
consoleMode = "auto";
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
plymouth = {
|
||||
enable = true;
|
||||
font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf";
|
||||
};
|
||||
|
||||
# Enable "Silent Boot"
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
initrd.systemd.enable = true;
|
||||
};
|
||||
|
||||
boot.lanzaboote = {
|
||||
enable = true;
|
||||
pkiBundle = "/etc/secureboot";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device =
|
||||
"/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716";
|
||||
|
||||
networking.hostName = "demeter"; # Define your hostname.
|
||||
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||
|
||||
# select kernel
|
||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||
|
||||
# Configure network proxy if necessary
|
||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Los_Angeles";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
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";
|
||||
# Bootloader.
|
||||
boot = {
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
timeout = 15;
|
||||
# Lanzaboote currently replaces the systemd-boot module.
|
||||
# This setting is usually set to true in configuration.nix
|
||||
# generated at installation time. So we force it to false
|
||||
# for now.
|
||||
systemd-boot = {
|
||||
enable = false;
|
||||
consoleMode = "auto";
|
||||
};
|
||||
};
|
||||
lanzaboote = {
|
||||
enable = true;
|
||||
pkiBundle = "/etc/secureboot";
|
||||
};
|
||||
|
||||
kernelPackages = pkgs.linuxPackages_zen;
|
||||
|
||||
initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device =
|
||||
"/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716";
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
NetworkManager-wait-online.enable = false;
|
||||
};
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
# You can disable this if you're only using the Wayland session.
|
||||
services.xserver.enable = false;
|
||||
|
||||
programs.nix-ld = {
|
||||
enable = true;
|
||||
libraries = with pkgs; [
|
||||
|
@ -132,24 +82,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
|
||||
services.blueman.enable = true;
|
||||
|
||||
# services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver = {
|
||||
xkb.layout = "us";
|
||||
xkb.variant = "";
|
||||
};
|
||||
|
||||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# services.xserver.libinput.enable = true;
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.youwen = {
|
||||
isNormalUser = true;
|
||||
|
@ -164,32 +96,6 @@
|
|||
];
|
||||
};
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="cpu_dma_latency", GROUP="realtime"
|
||||
'';
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget
|
||||
git
|
||||
curl
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
programs.zsh.enable = false;
|
||||
programs.fish.enable = true;
|
||||
users.users.youwen.shell = pkgs.fish;
|
||||
|
|
|
@ -46,12 +46,43 @@ in
|
|||
'';
|
||||
};
|
||||
suppressWarnings = lib.mkEnableOption "suppress warnings";
|
||||
networking = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''Whether to set up and enable networking daemons.'';
|
||||
};
|
||||
backend = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"wpa_supplicant"
|
||||
"iwd"
|
||||
];
|
||||
default = "wpa_supplicant";
|
||||
description = ''
|
||||
Which backend to use for networking. Default is wpa_supplicant with NetworkManager as a frontend. With iwd, iwctl is the frontend.
|
||||
'';
|
||||
};
|
||||
};
|
||||
bluetooth.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable bluetooth and blueman.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
inputs.viminal.packages.${pkgs.system}.default
|
||||
];
|
||||
environment.systemPackages =
|
||||
with pkgs;
|
||||
[
|
||||
wget
|
||||
git
|
||||
curl
|
||||
]
|
||||
++ [
|
||||
inputs.viminal.packages.${pkgs.system}.default
|
||||
];
|
||||
|
||||
environment.variables = {
|
||||
EDITOR = "nvim";
|
||||
|
@ -124,6 +155,33 @@ in
|
|||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
networking.networkmanager.enable = lib.mkIf (
|
||||
cfg.networking.enable && cfg.networking.backend == "wpa_supplicant"
|
||||
) true;
|
||||
|
||||
systemd.services.NetworkManager-wait-online.enable = lib.mkIf (
|
||||
cfg.networking.enable && cfg.networking.backend == "wpa_supplicant"
|
||||
) false;
|
||||
|
||||
networking.wireless.iwd = lib.mkIf (cfg.networking.enable && cfg.networking.backend == "iwd") {
|
||||
enable = true;
|
||||
settings.General.EnableNetworkConfiguration = true;
|
||||
};
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
|
||||
programs.dconf.enable = true;
|
||||
|
||||
hardware.bluetooth = lib.mkIf cfg.bluetooth.enable {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
|
||||
services.blueman.enable = lib.mkIf cfg.bluetooth.enable true;
|
||||
|
||||
warnings =
|
||||
if !cfg.suppressWarnings && cfg.useNh && config.liminalOS.flakeLocation == "" then
|
||||
[
|
||||
|
|
|
@ -26,5 +26,12 @@ in
|
|||
};
|
||||
|
||||
programs.hyprland.enable = cfg.hyprland.enable;
|
||||
|
||||
services.xserver.enable = false;
|
||||
|
||||
services.xserver = {
|
||||
xkb.layout = "us";
|
||||
xkb.variant = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -45,6 +45,11 @@ in
|
|||
Absolute filepath location of the NixOS system configuration flake.
|
||||
'';
|
||||
};
|
||||
useEnUsLocale = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to use the en_US locale automatically";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@ -80,5 +85,22 @@ in
|
|||
]
|
||||
)
|
||||
);
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = lib.mkIf cfg.useEnUsLocale {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,13 @@ in
|
|||
{
|
||||
options.liminalOS.theming = {
|
||||
enable = lib.mkEnableOption "theming";
|
||||
plymouth.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = cfg.enable;
|
||||
description = ''
|
||||
Whether to enable plymouth and sane defaults.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
@ -51,5 +58,26 @@ in
|
|||
size = 26;
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
plymouth = {
|
||||
enable = true;
|
||||
font = "${config.stylix.fonts.monospace.package}/share/fonts/truetype/NerdFonts/CaskaydiaCove/CaskaydiaCoveNerdFontMono-Regular.ttf";
|
||||
};
|
||||
|
||||
# Enable "Silent Boot"
|
||||
consoleLogLevel = 3;
|
||||
initrd.verbose = false;
|
||||
kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"boot.shell_on_fail"
|
||||
"rd.systemd.show_status=false"
|
||||
"rd.udev.log_level=3"
|
||||
"udev.log_priority=3"
|
||||
];
|
||||
initrd.systemd.enable = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue