diff --git a/.github/workflows/darwin.yml b/.github/workflows/darwin.yml new file mode 100644 index 0000000..57a365e --- /dev/null +++ b/.github/workflows/darwin.yml @@ -0,0 +1,13 @@ +name: "Build packages on darwin" +on: + pull_request: + push: + branches: + - 'master' +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4.2.2 + - uses: cachix/install-nix-action@v30 + - run: nix build -L .#nix2container-bin .#skopeo-nix2container diff --git a/default.nix b/default.nix index 6ae9cae..b0fc6c5 100644 --- a/default.nix +++ b/default.nix @@ -35,12 +35,15 @@ let # These lines may include revisions of differing length, based on how Github generates them. # fetchpatch2 does not filter out, but probably should fetchgitpatch = args: pkgs.fetchpatch2 (args // { + # On darwin, using sed with --in-place here fails as it tries to create + # temporary files at `/nix/store/`. postFetch = (args.postFetch or "") + '' - sed -i \ + sed \ -e '/^index /d' \ -e '/^similarity index /d' \ -e '/^dissimilarity index /d' \ - $out + $out > $tmpfile + mv $tmpfile $out ''; }); patch = fetchgitpatch {