2024-03-21 04:37:06 -05:00
|
|
|
|
{ config, pkgs, lib, nixos-hardware, ... }:
|
2024-03-18 16:16:39 -05:00
|
|
|
|
|
|
|
|
|
{
|
2024-03-21 04:37:06 -05:00
|
|
|
|
imports = [
|
|
|
|
|
# nixos-hardware.nixosModules.raspberry-pi-4
|
|
|
|
|
../../common/nixos/openssh.nix
|
|
|
|
|
];
|
2024-03-18 16:16:39 -05:00
|
|
|
|
|
2024-03-20 18:26:53 -05:00
|
|
|
|
nix = {
|
|
|
|
|
settings = {
|
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
trusted-users = [ "root" "@wheel" ];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-18 16:16:39 -05:00
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-18 16:22:54 -05:00
|
|
|
|
# # 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";
|
|
|
|
|
# };
|
|
|
|
|
# };
|
2024-03-18 16:16:39 -05:00
|
|
|
|
|
|
|
|
|
console.enable = false;
|
|
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
libraspberrypi
|
|
|
|
|
raspberrypi-eeprom
|
2024-03-20 17:15:51 -05:00
|
|
|
|
ssh-to-age
|
2024-03-20 17:45:18 -05:00
|
|
|
|
vim
|
2024-03-20 17:15:51 -05:00
|
|
|
|
git
|
|
|
|
|
curl
|
|
|
|
|
wget
|
|
|
|
|
dnsutils
|
2024-03-18 16:16:39 -05:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
|
hostName = "nixos";
|
|
|
|
|
wireless.enable = false;
|
|
|
|
|
networkmanager.enable = false;
|
|
|
|
|
};
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
2024-03-20 17:15:51 -05:00
|
|
|
|
# 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"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2024-03-18 16:16:39 -05:00
|
|
|
|
# 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";
|
|
|
|
|
|
|
|
|
|
}
|