From bcfc9ea4712617cdf599f18c31c6600041b55dd6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 8 Apr 2019 23:45:30 +0800 Subject: [PATCH] distribute aarch64 openocd --- main.nix | 4 +++- nixbld-etc-nixos/configuration.nix | 12 ++++++++++++ rpi-etc-nixos/configuration.nix | 7 ++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/main.nix b/main.nix index d0b4967..a32082a 100644 --- a/main.nix +++ b/main.nix @@ -1,5 +1,5 @@ -{ pkgs ? import {}}: let + pkgs = import {}; artiqSrc = ; generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; } '' @@ -34,6 +34,8 @@ let # This is in the example in the ARTIQ manual - precompile it to speed up # installation for users. matplotlib-qt = pkgs.lib.hydraJob (pkgs.python3Packages.matplotlib.override { enableQt = true; }); + # For Raspberry Pi JTAG servers + openocd-aarch64 = pkgs.lib.hydraJob ((import { system = "aarch64-linux"; }).callPackage ./artiq/pkgs/openocd.nix {}); }; in jobs // { diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index b3f0b22..019f193 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -68,6 +68,10 @@ extraGroups = ["networkmanager" "wheel" "plugdev" "dialout" "lp" "scanner"]; uid = 1000; }; + users.extraUsers.nix = { + isNormalUser = true; + uid = 1001; + }; security.sudo.wheelNeedsPassword = false; services.udev.packages = [ pkgs.openocd ]; services.udev.extraRules = '' @@ -89,6 +93,7 @@ ACTION=="add", SUBSYSTEM=="tty", \ nixpkgs.config.allowUnfree = true; + nix.distributedBuilds = true; nix.buildMachines = [ { hostName = "localhost"; @@ -96,6 +101,13 @@ ACTION=="add", SUBSYSTEM=="tty", \ system = "x86_64-linux"; supportedFeatures = ["big-parallel"]; } + { + hostName = "rpi-1"; + sshUser = "nix"; + sshKey = "/home/nix/.ssh/id_rsa"; + maxJobs = 1; + system = "aarch64-linux"; + } ]; services.hydra = { enable = true; diff --git a/rpi-etc-nixos/configuration.nix b/rpi-etc-nixos/configuration.nix index 5c141ef..d6f73b1 100644 --- a/rpi-etc-nixos/configuration.nix +++ b/rpi-etc-nixos/configuration.nix @@ -27,12 +27,16 @@ in time.timeZone = "Asia/Hong_Kong"; users.extraGroups.plugdev = { }; + security.sudo.wheelNeedsPassword = false; users.extraUsers.sb = { isNormalUser = true; extraGroups = ["wheel" "plugdev" "dialout"]; uid = 1000; }; - security.sudo.wheelNeedsPassword = false; + users.extraUsers.nix = { + isNormalUser = true; + uid = 1001; + }; services.udev.packages = [ m-labs.openocd ]; environment.systemPackages = with pkgs; [ @@ -41,4 +45,5 @@ in nix.binaryCachePublicKeys = ["nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc="]; nix.binaryCaches = ["https://cache.nixos.org" "https://nixbld.m-labs.hk"]; + nix.trustedUsers = ["root" "nix"]; }