configuration.nix/sdimage/piinstaller/default.nix

124 lines
2.8 KiB
Nix

{ lib, pkgs, modulesPath, username, ... }:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
boot.kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_rpi4;
boot.supportedFilesystems = lib.mkForce [ "vfat" "ext4" "btrfs" ];
hardware = {
deviceTree = {
enable = true;
};
raspberry-pi."4" = {
apply-overlays-dtmerge.enable = true;
poe-plus-hat.enable = true;
xhci.enable = true;
};
};
programs = {
git.enable = true;
zsh = {
enable = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
};
};
environment.pathsToLink = [ "/share/zsh" ];
environment.systemPackages = with pkgs; [
sops
age
libraspberrypi
raspberrypi-eeprom
];
sdImage.compressImage = false;
networking = {
nameservers = [
"2620:fe::fe#dns.quad9.net"
"9.9.9.9#dns.quad9.net"
"2620:fe::9#dns.quad9.net"
"149.112.112.112#dns.quad9.net"
];
networkmanager = {
enable = true;
dhcp = "dhcpcd";
dns = "systemd-resolved";
wifi = {
backend = "iwd";
powersave = false;
};
};
useDHCP = lib.mkDefault false;
wireless.iwd = {
enable = true;
settings = {
General = {
AddressRandomization = "network";
EnableNetworkConfiguration = false;
};
Settings = {
AutoConnect = "yes";
};
};
};
};
services.resolved = {
enable = true;
dnssec = "true";
dnsovertls = "true";
domains = [ "~." ];
fallbackDns = [ ];
};
services.openssh.enable = true;
security.sudo.wheelNeedsPassword = false;
users.users.${username} = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPxDgoV9yf+yPnp4pt5EWgo7uC25W66ehoL/rlshVW+8 Skipper"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPodFFNUK16y9bjHVMhr+Ykro3v1FVLbmqKg7mjMv3Wz Kowalski"
];
};
i18n = {
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";
LC_ALL = "en_US.UTF-8";
};
supportedLocales = [ "en_US.UTF-8/UTF-8" ];
};
time.timeZone = "Asia/Kolkata";
system = {
switch = {
enable = false;
enableNg = true;
};
stateVersion = "24.11";
};
}