OSX on nixos as vm - e.g. OSX-KVM

  • system: "x86_64-linux"
  • host os: Linux 5.15.104, NixOS, 22.11 (Raccoon), 22.11.3333.83607dae4e0
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.11.1
  • channels(root): "nixgl, nixos-22.11, nixos-hardware"
  • channels(usera): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

OSX-KVM]$ nix run --show-trace 
error: cannot fetch input 'path:./?lastModified=0&narHash=sha256-d4JZtpX3YhxsCIkAPcAyfzew18Su90AsP5BeNUqxUD0=' because it uses a relative path

       … while fetching the input 'path:./?lastModified=0&narHash=sha256-d4JZtpX3YhxsCIkAPcAyfzew18Su90AsP5BeNUqxUD0='

       … while evaluating anonymous lambda

       at «string»:10:13:

            9|     builtins.mapAttrs
           10|       (key: node:
             |             ^
           11|         let

       … from call site

       … while evaluating anonymous lambda

       at «string»:23:25:

           22|           inputs = builtins.mapAttrs
           23|             (inputName: inputSpec: allNodes.${resolveInput inputSpec})
             |                         ^
           24|             (node.inputs or {});

       … from call site

       … while evaluating the attribute 'text' of the derivation 'start'

       at /nix/store/nkhjmzkf9hky9h34yrfy0cgyd9pbh03v-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

Is there currently a working way of getting OSX up and running?

That flake is doing something very very weird. It has it inputs.osx-kvm.url = "path:./"; and inputs.osx-kvm.flake = false;. I believe relative paths like that worked in some Nix versions but I don’t think they do anymore. And either way, it’s completely silly. The self argument to outputs already represents this flake and can be used the way they’re using their osx-kvm input. Or just the ./. literal.

Also, just look at flake.nix. It’s not really doing anything significant. You may be better off just skipping this entirely.

1 Like