again
This commit is contained in:
43
modules/nixos/system/boot/default.nix
Normal file
43
modules/nixos/system/boot/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
33
modules/nixos/system/networking/default.nix
Normal file
33
modules/nixos/system/networking/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/nixos/system/networking/networkmanager/default.nix
Normal file
26
modules/nixos/system/networking/networkmanager/default.nix
Normal 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*" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
32
modules/nixos/system/time/default.nix
Normal file
32
modules/nixos/system/time/default.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user