cornflower: Initialize

This is a Raspberry Pi 4B.
This commit is contained in:
Spotlight 2025-02-03 20:54:38 -06:00
parent 574dbc7ded
commit 17591f82d4
Signed by: spotlight
GPG key ID: 874AA355B3209BDC
4 changed files with 162 additions and 12 deletions

View file

@ -0,0 +1,98 @@
# TODO(spotlightishere): Find a better way to disable desktop-specific components
{ config, lib, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
boot.loader = {
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf
generic-extlinux-compatible.enable = true;
};
# We want to ensure flakes, new Nix commands,
# and Garnix are available across all installs.
nix.settings = {
experimental-features = [ "flakes" "nix-command" ];
trusted-users = [ "spotlight" ];
builders-use-substitutes = true;
# Include Garnix
substituters = [ "https://cache.garnix.io" ];
trusted-public-keys = [ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" ];
};
# We generally want these network preferences across all installs.
networking = {
hostName = "cornflower";
domain = "host.fox-int.cloud";
networkmanager = {
enable = true;
# https://wiki.nixos.org/wiki/NixOS_on_ARM/Raspberry_Pi_4#Networking
wifi.powersave = false;
};
nameservers = [
# Quad9
"2620:fe::fe"
"9.9.9.9"
# Cloudflare
"2606:4700:4700::1111"
"1.1.1.1"
];
};
# Similarly, enforce baseline localisation.
time.timeZone = "America/Chicago";
i18n.defaultLocale = "en_US.UTF-8";
# We'd like Bonjour available.
services = {
avahi = {
enable = true;
# Enable .local resolution
nssmdns4 = true;
};
openssh = {
enable = true;
openFirewall = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
# Our user!
users.users.spotlight = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPQQO+c8ygVzRt55Z9qekqItSjYiw381cFPOqX+vGAGT MacBook Air 2020 macOS"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ/gyX9b80oml6z3UGOxVMJk/NS8R5w9NEITJcKb0MnU MacBook Air 2020 NixOS"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICpZtyCO6581/FdJHqSTXiFZ2XcxmUudP3sw7jjTzLiN Termius"
];
shell = pkgs.zsh;
};
# At a minimum, we'd like ZSH available.
programs.zsh.enable = true;
# Common utilities across most Linux installs.
environment.systemPackages = with pkgs; [
htop
git
neofetch
tmux
usbutils
vim
wget
];
# Please do not change this without reviewing release notes upstream.
system.stateVersion = "25.05"; # Did you read the comment?
}

View file

@ -0,0 +1,34 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.end0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}