mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-19 21:49:52 -07:00
refactor: configure more core system options via liminalOS module
This commit is contained in:
parent
104a61a055
commit
1aa376e94f
5 changed files with 144 additions and 123 deletions
|
@ -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
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue