Last active
February 10, 2019 06:10
-
-
Save alexvorobiev/c85925414515928a13dd9260ca31123a to your computer and use it in GitHub Desktop.
NixOS on rpi3
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, pkgs, lib, ... }: | |
{ | |
# NixOS wants to enable GRUB by default | |
boot.loader.grub.enable = false; | |
# Enables the generation of /boot/extlinux/extlinux.conf | |
boot.loader.generic-extlinux-compatible.enable = true; | |
# !!! If your board is a Raspberry Pi 1, select this: | |
# boot.kernelPackages = pkgs.linuxPackages_rpi; | |
# !!! Otherwise (even if you have a Raspberry Pi 2 or 3), pick this: | |
boot.kernelPackages = pkgs.linuxPackages_latest; | |
# !!! This is only for ARMv6 / ARMv7. Don't enable this on AArch64, cache.nixos.org works there. | |
# nix.binaryCaches = lib.mkForce [ "http://nixos-arm.dezgeg.me/channel" ]; | |
# nix.binaryCachePublicKeys = [ "nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%" ]; | |
# !!! Needed for the virtual console to work on the RPi 3, as the default of 16M doesn't seem to be enough. | |
boot.kernelParams = ["cma=128M"]; | |
# File systems configuration for using the installer's partition layout | |
fileSystems = { | |
"/boot" = { | |
device = "/dev/disk/by-label/NIXOS_BOOT"; | |
fsType = "vfat"; | |
}; | |
"/" = { | |
device = "/dev/disk/by-label/NIXOS_SD"; | |
fsType = "ext4"; | |
}; | |
}; | |
# !!! Adding a swap file is optional, but strongly recommended! | |
swapDevices = [ { device = "/swapfile"; size = 1024; } ]; | |
networking.hostName = "rpi"; | |
networking.wireless.enable = true; | |
i18n = { | |
consoleKeyMap = "us"; | |
defaultLocale = "en_US.UTF-8"; | |
}; | |
time.timeZone = "America/Chicago"; | |
environment.systemPackages = with pkgs; [ | |
wget | |
binutils | |
mc | |
nix | |
gitAndTools.gitFull | |
emacs | |
#firefox-bin | |
#chromium | |
tmux | |
#haskellPackages.xmonad | |
#haskellPackages.xmobar | |
xfontsel | |
xlsfonts | |
xscreensaver | |
awesome | |
dmenu | |
xclip | |
lilyterm | |
]; | |
services.openssh.enable = true; | |
services.xserver = { | |
enable = true; | |
layout = "us"; | |
videoDrivers = ["modesetting"]; | |
# #windowManager.xmonad = { | |
# # enable = true; | |
# # enableContribAndExtras = true; | |
# #}; | |
windowManager.awesome = { | |
enable = true; | |
}; | |
windowManager.default = "awesome"; | |
displayManager = { | |
slim = { | |
enable = true; | |
defaultUser = "alex"; | |
}; | |
}; | |
}; | |
programs.ssh.startAgent = true; | |
users.extraUsers.alex = { | |
isNormalUser = true; | |
uid = 1000; | |
}; | |
system.stateVersion = "unstable"; | |
nixpkgs.config.allowUnfree = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment