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"]; }