summaryrefslogtreecommitdiffstats
path: root/makefu/1systems/crapi/hardware-config.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2019-03-21 20:09:09 +0100
committerjeschli <jeschli@gmail.com>2019-03-21 20:09:09 +0100
commita045a7f054859efcb40baf8ded13bcb7fd706d01 (patch)
treedf23b0d31db9fc0b0087f4d5d4c7b3dd7a88b44c /makefu/1systems/crapi/hardware-config.nix
parented499a84a9fe067c80e5a4768482333863c1e9ad (diff)
parent550faa1f64434951cd3949bc96a25012349f0090 (diff)
Merge branch 'master' of prism.r:stockholm into new-master
Diffstat (limited to 'makefu/1systems/crapi/hardware-config.nix')
-rw-r--r--makefu/1systems/crapi/hardware-config.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/makefu/1systems/crapi/hardware-config.nix b/makefu/1systems/crapi/hardware-config.nix
new file mode 100644
index 00000000..bba31dab
--- /dev/null
+++ b/makefu/1systems/crapi/hardware-config.nix
@@ -0,0 +1,39 @@
+{ pkgs, lib, ... }:
+{
+ #raspi1
+ boot.kernelParams = ["cma=32M" "console=ttyS0,115200n8" "console=tty0" "console=ttyS1,115200n8" ];
+
+ boot.loader.grub.enable = false;
+ boot.loader.raspberryPi.enable = true;
+ boot.loader.raspberryPi.version = 1;
+ boot.loader.raspberryPi.uboot.enable = true;
+ boot.loader.raspberryPi.uboot.configurationLimit = 1;
+ boot.loader.generationsDir.enable = lib.mkDefault false;
+ hardware.enableRedistributableFirmware = true;
+ boot.cleanTmpDir = true;
+ environment.systemPackages = [ pkgs.raspberrypi-tools ];
+ boot.kernelPackages = pkgs.linuxPackages_rpi;
+
+ nix.binaryCaches = [ "http://nixos-arm.dezgeg.me/channel" ];
+ nix.binaryCachePublicKeys = [ "nixos-arm.dezgeg.me-1:xBaUKS3n17BZPKeyxL4JfbTqECsT+ysbDJz29kLFRW0=%" ];
+
+ fileSystems = {
+ "/boot" = {
+ device = "/dev/disk/by-label/NIXOS_BOOT";
+ fsType = "vfat";
+ };
+ "/" = {
+ device = "/dev/disk/by-label/NIXOS_SD";
+ fsType = "ext4";
+ };
+ };
+
+ system.activationScripts.create-swap = ''
+ if [ ! -e /swapfile ]; then
+ fallocate -l 2G /swapfile
+ mkswap /swapfile
+ chmod 600 /swapfile
+ fi
+ '';
+ swapDevices = [ { device = "/swapfile"; size = 4096; } ];
+}