# Plutus Example Project - Nix-shell issue - MacOS Big Sur

**URL:** <https://forum.cardano.org/t/plutus-example-project-nix-shell-issue-macos-big-sur/52179>\
**Category:** Smart Contracts\
**Tags:** plutus\
**Created:** [6 March 2021 16:27 UTC](https://forum.cardano.org/t/plutus-example-project-nix-shell-issue-macos-big-sur/52179 "2021-03-06T16:27:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lenigmaus](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@lenigmaus](https://forum.cardano.org/u/lenigmaus)\
**Post date:** [6 March 2021 16:27 UTC](https://forum.cardano.org/t/plutus-example-project-nix-shell-issue-macos-big-sur/52179/1 "2021-03-06T16:27:35Z")

</div>

Hey Guys,

I was trying to set up a **Plutus example project** locally on my Mac following this:  
[https://github.com/input-output-hk/plutus/blob/master/example/README.md](https://github.com/input-output-hk/plutus/blob/master/example/README.md)

Configuration:

- MacOS Big Sur 11.2.2
- Nix 2.3.10
- IOHK binary cache added to `nix.conf`
- Plutus-Core built successfully

After trying to start `nix-shell` the following error occurs:

> these derivations will be built:  
> /nix/store/2grsr21ij9nffkk74cqpkf0h4sinnwm2-hscolour-1.24.4.drv  
> /nix/store/78iixzimzwapfxn34nklrjjwrqjjhl2q-zlib-0.6.2.2.drv  
> /nix/store/4sdy84iybdpyk23iias6lwcrhfk87djq-ghc-8.10.2-with-packages.drv  
> error: while setting up the build environment: getting attributes of path ‘/usr/lib/libSystem.B.dylib’: No such file or directory

Does anyone know perhaps how to fix this?

It looks like a build issue specific to Big Sur and Nix. The help I could find so far is [this](https://daiderd.com/2020/06/25/nix-and-libsystem.html) but that’s too generic and since I’m kind of new to Nix I’m not sure how to follow through with that.

Thanks.

---

<div class="post-metadata">

**Author:** ![lenigmaus](https://avatars.discourse-cdn.com/v4/letter/l/bbe5ce/32.png) [@lenigmaus](https://forum.cardano.org/u/lenigmaus)\
**Post date:** [9 March 2021 17:14 UTC](https://forum.cardano.org/t/plutus-example-project-nix-shell-issue-macos-big-sur/52179/2 "2021-03-09T17:14:06Z")

</div>

I managed to have this issue sorted out. It’s probably going to go away as the new stable version of Nix will be released working with this version of Big Sur. But for the sake of people who may encounter it, here is one solution.

1. The first problem was, that I’ve set up Sandboxing for Nix on Mac according [this](https://github.com/input-output-hk/plutus#nix-on-macos). I shouldn’t have had. It doesn’t work on Big Sur 11.2.2

2. After this if you try to run `nix-shell` it fails with another problem. It tries to build `ghc 8.10.2`, but it fails as it won’t find the `libcache.dylib` and cannot link the respective symbols. It is also a [side-effect](https://github.com/NixOS/nixpkgs/issues/104580) of Big Sur 11.2.2 and this version of `nixpkgs` (20.09). To resolve this you need to use a newer (unstable) build of `nixpkgs` where this has been fixed. To do that here is one way to do it (I’m definitely not a Nix pro, so probably there are better ways to do this. This at least worked for me):

- Add an `unstable` nix channel by following [this](https://nix-tutorial.gitlabpages.inria.fr/nix-tutorial/getting-started.html#channels)
- Update `shell.nix` for the example contract to use that and do not fetch `20.09`. I couldn’t find a tarball for the unstable version, so I went with this solution for `shell.nix`:

```auto
{ nixpkgs ? import <unstable> {} }:
let runtimeGhc = nixpkgs.haskell.packages.ghc8102.ghcWithPackages (ps: with ps; [zlib]);
in
with nixpkgs; mkShell {
  buildInputs = [
    runtimeGhc
    cabal-install
    stack
    wget
    curl
    binutils
    git
    vim
    openssl.dev
  ];
}

```

---

<div class="post-metadata">

**Author:** ![Ben\_greg](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ben_greg/32/37578_2.png) [@Ben\_greg](https://forum.cardano.org/u/Ben_greg)\
**Post date:** [19 June 2021 17:26 UTC](https://forum.cardano.org/t/plutus-example-project-nix-shell-issue-macos-big-sur/52179/3 "2021-06-19T17:26:07Z")

</div>

I’m a little bit uncertain about how to apply the **shell.nix** script you are referring to.

I have tried adding it to the end of the original **shell.nix** script in the Plutus directory but I get a syntax error.

```auto
error: syntax error, unexpected '?', expecting '.' or '=', at /Users/bob/Documents/personal/plutus/plutus/shell.nix:119:11

```

Any ideas?

Thanks in advance.
