summaryrefslogtreecommitdiffstats
path: root/raspberry-pi
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@gmail.com>2017-12-22 20:17:00 +0300
committerzimbatm <zimbatm@zimbatm.com>2017-12-22 17:17:00 +0000
commit3c9f432a7146115b2d0b6200c4c19101c29caaba (patch)
tree0e0a9c6ab58f8eda82624a5b7f7238fefb6244ed /raspberry-pi
parent3f2fbacb216c8905f8ca15d2c24fe95472fb9ab2 (diff)
treewide: modules -> profiles, separate dirs, list in README (#29)
Enforce proper naming: all paths are lowercase and hyphen-separated, if there's a line of models (aspire, macbook-pro, thinkpad) it becomes a subdirectory. Documentation for profiles is moved to README files in respective directories. Add an Org mode table that lists all available profiles and their paths. Instead of fetching repo locally, use a Nix channel. Making hardware profiles read-only should improve quality and amount of participation long-term.
Diffstat (limited to 'raspberry-pi')
-rw-r--r--raspberry-pi/2/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/raspberry-pi/2/default.nix b/raspberry-pi/2/default.nix
new file mode 100644
index 0000000..897871e
--- /dev/null
+++ b/raspberry-pi/2/default.nix
@@ -0,0 +1,64 @@
+/** imported from https://nixos.org/wiki/Raspberry_Pi_2 **
+
+# Status
+The code in master as of June 2015 should be able to prepare a bootable NixOS for Raspberry PI 2.
+
+There are still some drawbacks:
+
+NixOS does not provide a /boot/config.txt (the FAT32 partition).
+Making NixOS work in the Raspberry PI 2 is mainly the result of the recent work of ambro718, Dezgeg and viric (#nixos@irc.freenode.net).
+
+# Download
+If you want to test, you can flash this 4GB SD image (DOS partition table + fat32 + ext4 rootfs):
+magnet:?xt=urn:btih:0def3f6acb3bceddb22cb24098f58e40e2853ec2&dn=rpi2-nixos-4b09501f2-img.xz&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80
+
+Then you should be able to nixos-rebuild any configuration.nix changes.
+
+The image is the result of a "nixos-install" alone. No root password has been set, and it does not include a nixpkgs checkout or channel.
+
+In fact I (viric) created the FS into a NBD, not a real SD, to create this image.
+
+*/
+
+{ pkgs, config, lib, ...}:
+
+{
+ boot.consoleLogLevel = 7;
+ boot.loader.grub.enable = false;
+ boot.loader.generationsDir.enable = false;
+ boot.loader.raspberryPi.enable = true;
+ boot.loader.raspberryPi.version = 2;
+ boot.extraTTYs = [ "ttyAMA0" ];
+ boot.kernelPackages = pkgs.linuxPackages_rpi;
+ boot.kernelParams = [
+ #"coherent_pool=6M"
+ #"smsc95xx.turbo_mode=N"
+ "dwc_otg.lpm_enable=0"
+ "console=ttyAMA0,115200"
+ "rootwait"
+ #"console=tty1"
+ "elevator=deadline"
+ ];
+
+ # cpufrequtils doesn't build on ARM
+ powerManagement.enable = false;
+
+ services.xserver.enable = false;
+ services.openssh.enable = true;
+
+ services.nixosManual.enable = false;
+
+ nixpkgs.config = {
+ # Since https://github.com/NixOS/nixpkgs/commit/f0b634c7e838cdd65ac6f73933c99af3f38d0fa8
+ nixpkgs.config.platform = lib.systems.platforms.raspberrypi2;
+ # Earlier than that, use this:
+ # platform = pkgs.platforms.raspberrypi2;
+ # Also be aware of this issue if you're encountering infinite recursion:
+ # https://github.com/NixOS/nixpkgs/issues/24170
+
+ allowUnfree = true;
+ };
+
+ nix.buildCores = 4;
+ nix.binaryCaches = [ ];
+}