From 78ad5a2b51c61849e2fcd8c17beda85a7df5d71f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 20 Mar 2019 19:58:30 +0800 Subject: [PATCH] add Raspberry Pi JTAG server configuration.nix --- rpi-etc-nixos/configuration.nix | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 rpi-etc-nixos/configuration.nix diff --git a/rpi-etc-nixos/configuration.nix b/rpi-etc-nixos/configuration.nix new file mode 100644 index 0000000..5c141ef --- /dev/null +++ b/rpi-etc-nixos/configuration.nix @@ -0,0 +1,44 @@ +{ config, pkgs, lib, ... }: +let + m-labs = import (fetchTarball https://nixbld.m-labs.hk/channel/custom/artiq/main/channel/nixexprs.tar.xz) {}; +in +{ + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + boot.kernelParams = ["cma=32M console=ttyS1,115200n8"]; + + fileSystems = { + "/boot" = { + device = "/dev/disk/by-label/NIXOS_BOOT"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + }; + + services.openssh.enable = true; + + networking.hostName = "rpi-1"; + time.timeZone = "Asia/Hong_Kong"; + + users.extraGroups.plugdev = { }; + users.extraUsers.sb = { + isNormalUser = true; + extraGroups = ["wheel" "plugdev" "dialout"]; + uid = 1000; + }; + security.sudo.wheelNeedsPassword = false; + services.udev.packages = [ m-labs.openocd ]; + + environment.systemPackages = with pkgs; [ + wget vim git usbutils mosh tmux xc3sprog m-labs.openocd + ]; + + nix.binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="]; + nix.binaryCaches = ["https://cache.nixos.org" "https://nixbld.m-labs.hk"]; +}