Last active
May 25, 2020 21:39
-
-
Save chrisanthropic/d60e865f9033052b9393d305a215523b to your computer and use it in GitHub Desktop.
nixos-raspi4-configuration.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ 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 | |
]; | |
} |
Author
chrisanthropic
commented
May 25, 2020
- Full readme here: https://gist.github.com/chrisanthropic/2e6d3645f20da8fd4c1f122113f89c06
- matching hardware-configuration.nix here: https://gist.github.com/chrisanthropic/14e726da7fe39aba038b8488001e6254
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment