Skip to content

Instantly share code, notes, and snippets.

@chrisanthropic
Last active May 25, 2020 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisanthropic/d60e865f9033052b9393d305a215523b to your computer and use it in GitHub Desktop.
Save chrisanthropic/d60e865f9033052b9393d305a215523b to your computer and use it in GitHub Desktop.
nixos-raspi4-configuration.nix
{ config, libs, pkgs, ... }:
{
#################
## NixOS Version
#################
system.stateVersion = "20.03";
###########
## Imports
###########
imports =
[
./hardware-configuration.nix
];
##############
## Bootloader
##############
boot = {
loader.grub.enable = false;
loader.raspberryPi.enable = true;
loader.raspberryPi.version = 4;
kernelPackages = pkgs.linuxPackages_rpi4;
};
###########
## Network
###########
networking = {
hostName = "nixos";
useDHCP = false;
interfaces.eth0.useDHCP = true;
};
##########
## Locale
##########
i18n.defaultLocale = "en_US.UTF-8";
###########
# TimeZone
###########
time.timeZone = "America/Los_Angeles";
#########
## Fonts
#########
console = {
font = "Lat2-Terminus16";
keyMap = "us";
};
#######
## SSH
#######
services.openssh = {
enable = true;
permitRootLogin = "yes";
passwordAuthentication = false;
challengeResponseAuthentication = false;
};
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
#########
## Users
#########
users.users.$USERNAME = {
isNormalUser = true;
home = "/home/$USERNAME";
extraGroups = [ "wheel" "networkmanager" ];
openssh.authorizedKeys.keys = [ "$YOUR_PUBLIC_KEY" ];
};
###############
## Global Apps
###############
environment.systemPackages = with pkgs; [
vim
];
}
@chrisanthropic
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment