82 lines
1.8 KiB
Nix
82 lines
1.8 KiB
Nix
{ config, pkgs, lib, ... }:
|
||
|
||
{
|
||
# imports = [
|
||
# <nixos-hardware/raspberry-pi/4>
|
||
# ];
|
||
|
||
nixpkgs = {
|
||
|
||
# Configure your nixpkgs instance
|
||
config = {
|
||
# Disable if you don't want unfree packages
|
||
allowUnfree = true;
|
||
};
|
||
};
|
||
|
||
boot = {
|
||
initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
|
||
# ttyAMA0 is the serial console broken out to the GPIO
|
||
kernelParams = [
|
||
"8250.nr_uarts=1"
|
||
"console=ttyAMA0,115200"
|
||
"console=tty1"
|
||
];
|
||
loader = {
|
||
grub.enable = false;
|
||
raspberryPi = {
|
||
version = 4;
|
||
};
|
||
};
|
||
};
|
||
|
||
# # https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi_4
|
||
# hardware = {
|
||
# raspberry-pi."4".apply-overlays-dtmerge.enable = true;
|
||
# deviceTree = {
|
||
# enable = true;
|
||
# filter = "*rpi-4-*.dtb";
|
||
# };
|
||
# };
|
||
|
||
console.enable = false;
|
||
|
||
environment.systemPackages = with pkgs; [
|
||
libraspberrypi
|
||
raspberrypi-eeprom
|
||
ssh-to-age
|
||
vi
|
||
git
|
||
curl
|
||
wget
|
||
dnsutils
|
||
];
|
||
|
||
networking = {
|
||
hostName = "nixos";
|
||
wireless.enable = false;
|
||
networkmanager.enable = false;
|
||
};
|
||
services.openssh.enable = true;
|
||
|
||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||
users.users.truxnell = {
|
||
isNormalUser = true;
|
||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||
packages = with pkgs; [
|
||
];
|
||
openssh.authorizedKeys.keys = [
|
||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZS9J1ydflZ4iJdJgO8+vnN8nNSlEwyn9tbWU9OcysW truxnell@home"
|
||
];
|
||
};
|
||
|
||
# Free up to 1GiB whenever there is less than 100MiB left.
|
||
nix.extraOptions = ''
|
||
min-free = ${toString (100 * 1024 * 1024)}
|
||
max-free = ${toString (1024 * 1024 * 1024)}
|
||
'';
|
||
nixpkgs.hostPlatform = "aarch64-linux";
|
||
|
||
system.stateVersion = "23.11";
|
||
|
||
}
|