This commit is contained in:
2025-03-31 18:24:49 -04:00
parent 6cfbc68c8b
commit dccbb234f2
70 changed files with 1276 additions and 206 deletions

View File

@@ -0,0 +1,43 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.boot;
in
{
options.${namespace}.system.boot = {
enable = lib.mkEnableOption "booting";
silentBoot = lib.mkEnableOption "silent boot";
showNotch = lib.mkEnableOption "show macOS notch";
};
config = mkIf cfg.enable {
boot = {
kernelParams = lib.optionals cfg.silentBoot [
"quiet"
"loglevel=3"
"udev.log_level=3"
"rd.udev.log_level=3"
"systemd.show_status=auto"
"rd.systemd.show_status=auto"
"vt.global_cursor_default=0"
] ++ lib.optionals cfg.showNotch [
"apple_dcp.show_notch=1"
];
loader = {
efi = {
canTouchEfiVariables = false;
};
systemd-boot = {
enable = true;
configurationLimit = 20;
editor = false;
};
timeout = 1;
};
};
};
}

View File

@@ -0,0 +1,33 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf mkForce;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.system.networking;
in
{
options.${namespace}.system.networking = {
enable = lib.mkEnableOption "networking support";
enableIWD = mkBoolOpt false "enable iwd";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
mtr
tcpdump
traceroute
];
reichard.user.extraGroups = [ "network" ];
networking = {
firewall.enable = true;
usePredictableInterfaceNames = mkForce true;
} // (lib.optionalAttrs cfg.enableIWD) {
wireless.iwd = {
enable = true;
settings.General.EnableNetworkConfiguration = true;
};
};
};
}

View File

@@ -0,0 +1,26 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.networking;
in
{
config = mkIf cfg.enable {
reichard.user.extraGroups = [ "networkmanager" ];
networking.networkmanager = {
enable = true;
connectionConfig = {
"connection.mdns" = "2";
};
# unmanaged = [
# "interface-name:br-*"
# "interface-name:rndis*"
# ]
# ++ lib.optionals config.${namespace}.virtualisation.podman.enable [ "interface-name:docker*" ]
# ++ lib.optionals config.${namespace}.virtualisation.kvm.enable [ "interface-name:virbr*" ];
};
};
}

View File

@@ -0,0 +1,32 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.time;
in
{
options.${namespace}.system.time = {
enable = lib.mkEnableOption "time related settings";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.openntpd ];
networking.timeServers = [
"0.nixos.pool.ntp.org"
"1.nixos.pool.ntp.org"
"2.nixos.pool.ntp.org"
"3.nixos.pool.ntp.org"
];
services.openntpd = {
enable = true;
extraConfig = ''
listen on 127.0.0.1
listen on ::1
'';
};
time.timeZone = "America/New_York";
};
}