{ pkgs, lib, config, nixpkgs, pwnix, ... }: let cfg = config.custom.nix; in with lib; { options.custom.nix = { distributedBuilds.enable = (mkEnableOption "distributed builds on strawberry") // { default = true; }; }; # TODO: Add strawberry as a build machine here config = mkMerge [ { nixpkgs.config.allowUnfree = true; nix = { extraOptions = '' experimental-features = nix-command flakes ''; registry.nixpkgs.flake = nixpkgs; registry.pwnix.flake = pwnix; settings.trusted-users = [ "@wheel" "root" ]; }; } (mkIf cfg.distributedBuilds.enable { nix.distributedBuilds = true; nix.buildMachines = [{ hostName = "strawberry"; sshUser = "nix-build"; sshKey = "/etc/ssh/ssh_host_ed25519_key"; systems = [ "x86_64-linux" "aarch64-linux" ]; supportedFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; }]; }) ]; }