This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/nixos/hosts/images/sd-image/default.nix
2024-03-21 09:15:51 +11:00

82 lines
1.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ 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";
}