A swift-based binary that can be used as an external builder for nix (via external-builders experimental feature) to build linux packages on darwin without having to setup a full remote build VM. This project aims to reproduce the functionality of Determinate Nix's native-linux-builder for upstream Nix installs. It also provides a Nix-darwin module to configure the external builder.
If you manage your system with Nix-darwin, import the module exposed by the flake into your configuration and enable the option:
{ inputs, ... }:
imports = [ inputs.alternative-linux-builder.darwinModules.default ];
programs.alternative-linux-builder = {
enable = true;
};
If you don't use Nix-darwin, you can install the package via profiles:
nix profile add github:quinneden/alternative-linux-builder
and configure it directly in /etc/nix/nix.conf:
extra-experimental-features = external-builders
# external-builders takes a list of JSON objects as it's value. Required fields
# are:
# - program: path to the executable
# - args: CLI arguments passed to the executable
# - systems: list of systems this builder can build for
external-builders = [{"program": "/Users/<user>/.nix-profile/bin/alternativeLinuxBuilder", "args": [], "systems": ["aarch64-linux", "x86_64-linux"]}]
# Optionally, you can configure the number of CPU cores and amount of memory in
# the 'args' field via the '-c,--cores' and '-m,--memory' flags, respectively.
# E.g.:
# external-builders = [{"program": "...", "args": ["-c" "8", "-m", "8192"], ...}]
then restart the nix-daemon:
sudo launchctl kickstart -k system/org.nixos.nix-daemon
| Option | Type | Default | Description |
|---|---|---|---|
cores | int | 1 | Number of CPU cores allocated to the VM. |
kernel | package | pkgs.linux | The kernel package to use. |
memory | null or int | null | Amount of memory allocated to the VM in mebibytes. |
3 commits
Nix
58.6%
Swift
35.3%
Shell
6.1%
A swift-based binary that can be used as an external builder for nix (via external-builders experimental feature) to build linux packages on darwin without having to setup a full remote build VM. This project aims to reproduce the functionality of Determinate Nix's native-linux-builder for upstream Nix installs. It also provides a Nix-darwin module to configure the external builder.
If you manage your system with Nix-darwin, import the module exposed by the flake into your configuration and enable the option:
{ inputs, ... }:
imports = [ inputs.alternative-linux-builder.darwinModules.default ];
programs.alternative-linux-builder = {
enable = true;
};
If you don't use Nix-darwin, you can install the package via profiles:
nix profile add github:quinneden/alternative-linux-builder
and configure it directly in /etc/nix/nix.conf:
extra-experimental-features = external-builders
# external-builders takes a list of JSON objects as it's value. Required fields
# are:
# - program: path to the executable
# - args: CLI arguments passed to the executable
# - systems: list of systems this builder can build for
external-builders = [{"program": "/Users/<user>/.nix-profile/bin/alternativeLinuxBuilder", "args": [], "systems": ["aarch64-linux", "x86_64-linux"]}]
# Optionally, you can configure the number of CPU cores and amount of memory in
# the 'args' field via the '-c,--cores' and '-m,--memory' flags, respectively.
# E.g.:
# external-builders = [{"program": "...", "args": ["-c" "8", "-m", "8192"], ...}]
then restart the nix-daemon:
sudo launchctl kickstart -k system/org.nixos.nix-daemon
| Option | Type | Default | Description |
|---|---|---|---|
cores | int | 1 | Number of CPU cores allocated to the VM. |
kernel | package | pkgs.linux | The kernel package to use. |
memory | null or int | null | Amount of memory allocated to the VM in mebibytes. |
3 commits
Nix
58.6%
Swift
35.3%
Shell
6.1%