Skip to content

Commit

Permalink
build linux images on darwin (#83)
Browse files Browse the repository at this point in the history
The assert in pkgs.nix currently just throws if you try to build on
darwin. As there's no such thing as darwin in a container, I believe
it should be safe to assume that people want to build linux containers.

This defaults to the current platform, but still lets users specify
system to i.e. build x86_64-linux containers from an aarch64-darwin host.
  • Loading branch information
phaer authored Aug 5, 2024
1 parent 0ce26f2 commit 8e9c7e7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
system ? builtins.currentSystem
}: let
pkgs = import ./pkgs.nix system;
_parts = builtins.split "-" system;
arch = builtins.elemAt _parts 0;
os = builtins.elemAt _parts 2;
system' =
if os == "darwin"
then "${arch}-linux"
else system;
pkgs =
import ./pkgs.nix system';
in
pkgs.docker-nixpkgs

0 comments on commit 8e9c7e7

Please sign in to comment.