nix-config/hosts/common/core/system.nix
Patrick Großmann cf61c70015
fix: zfs mounting when using systemd initrd
fix: enabled systemd emergency access
2023-05-19 01:41:40 +09:00

61 lines
1.4 KiB
Nix

{
inputs,
lib,
nodePath,
pkgs,
nodeName,
...
}: {
rekey = {
inherit
(inputs.self.secrets)
masterIdentities
extraEncryptionPubkeys
;
forceRekeyOnSystem = builtins.extraBuiltins.unsafeCurrentSystem;
hostPubkey = let
pubkeyPath = nodePath + "/secrets/host.pub";
in
lib.mkIf (lib.pathExists pubkeyPath || lib.trace "Missing pubkey for ${nodeName}: ${toString pubkeyPath} not found, using dummy replacement key for now." false)
pubkeyPath;
};
boot = {
initrd.systemd.enable = true;
initrd.systemd.emergencyAccess = true;
initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" "rtsx_pci_sdmmc"];
supportedFilesystems = ["ntfs"];
kernelModules = ["kvm-intel"];
tmp.useTmpfs = true;
};
security.sudo.enable = false;
time.timeZone = lib.mkDefault "Europe/Berlin";
i18n.defaultLocale = "C.UTF-8";
services.xserver = {
layout = "de";
xkbVariant = "bone";
};
console = {
font = "ter-v28n";
packages = with pkgs; [terminus_font];
useXkbConfig = true; # use xkbOptions in tty.
keyMap = lib.mkDefault "de-latin1-nodeadkeys";
};
users.mutableUsers = false;
environment.systemPackages = with pkgs; [
wget
gcc
tree
rage
file
ripgrep
killall
fd
];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}