0

I'm trying to write a nix flake that produces a shell to compile a tex project from two different systems: One linux x86_64 and one MacOs aarch64-darwin.

I'm quite new to nix and flakes, so I took the example flake given on the nixos wiki "Super fast nix-shell". It works well on linux x86 but nix develop fails on MacOs and I can't figure out where is the problem.

Here are my flake.nix and shell.nix:

{
  description = "Build Shell with any dependency of the project";

  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem
      (system:
        let pkgs = nixpkgs.legacyPackages.${system}; in
        {
          devShells.default = import ./shell.nix { inherit pkgs; };
        }
      );
}
{ pkgs ? import <nixpkgs> {} }:
  let
    tex = pkgs.texlive.combine
      {
        inherit (pkgs.texlive)
          scheme-medium
          pgf
          standalone
          minted
          tcolorbox
          environ
          tabto-ltx
          circuitikz
          lastpage
          tabularray
          pygmentex
          ninecolors
          multirow;
      };
  in
    pkgs.mkShell
      {
        nativeBuildInputs = [ pkgs.python310Packages.pygments tex ];
      }

When using 'nix develop' on MacOs, I get the following error:

error: flake 'git+file:///PATH_TO_FLAKE' does not provide attribute 'devShells.aarch64-darwin.devShell.aarch64-darwin', 'packages.aarch64-darwin.devShell.aarch64-darwin', 'legacyPackages.aarch64-darwin.devShell.aarch64-darwin', 'devShell.aarch64-darwin' or 'defaultPackage.aarch64-darwin'

1 Answer 1

0

I finally got it to work as intended. No problem in my flake, I found out that my nix installation was outdated and in a strange state that couldn't be updated. The solution was to completely uninstall nix and start over from a clean up to date install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.