Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development sandbox does not work on MacOS #174

Open
kadaan opened this issue Dec 3, 2024 · 5 comments
Open

Development sandbox does not work on MacOS #174

kadaan opened this issue Dec 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@kadaan
Copy link

kadaan commented Dec 3, 2024

Describe the bug

Development sandbox does not work on MacOS because a number of the Nix packages are not available for MacOS.

  1. iproute2: not applicable to MacOS
  2. kanidm: not packaged in nix for MacOS, but available in homebrew
@kadaan kadaan added the bug Something isn't working label Dec 3, 2024
@khuedoan
Copy link
Owner

khuedoan commented Dec 3, 2024

Thanks for letting me know about this issue, I’ll update the document to reflect that it doesn’t work on macOS. I might add a short instruction on how to create a virtual machine for non-Linux platforms.

@kadaan
Copy link
Author

kadaan commented Dec 3, 2024

Commenting both out let me get a lot further, to terraform. That said, I ran out of time to go further and don't want to test with my existing cloudfllare account.

Ideally nix would have a kanidm-cli package as that seems to be all you need for the development environment. I was able to adjust your flake.nix to to build a kanidm-cli by adding:

        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true;
       
         #########  Start of addition 
         overlays = [
            (import (
              fetchTarball {
                url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
                sha256 = "sha256:1crrpxl6qvc6kspr7q9x94bham6kpvh4d09ajvraajxpz2hcl2wz";
              })
            )
          ];
        };
        rustPlatform = pkgs.makeRustPlatform {
          cargo = pkgs.rust-bin.stable.latest.minimal;
          rustc = pkgs.rust-bin.stable.latest.minimal;
        };
        kanidm-cli = rustPlatform.buildRustPackage rec {
          pname = "kanidm";
          version = "1.4.3";

          src = pkgs.fetchzip {
            url = "https://github.com/kanidm/kanidm/archive/refs/tags/v${version}.tar.gz";
            hash = "sha256-zI+IPwpkkF67/JSl3Uu+Q1giUN49r/hjvY+/QLqB5eM=";
          };

          nativeBuildInputs = [ pkgs.openssl pkgs.pam ];

          cargoHash = "sha256-l4UNdVvPteqs46Fm7yVgkgplANvkAmb4fooLigXRqZM=";

          cargoRoot = "tools/cli";
          cargoLock = {
            lockFile = "${src}/Cargo.lock";
          };

          cargoBuildFlags = [ "--bin" "kanidm" ];

          postPatch = ''
            ln -s ${src}/Cargo.lock tools/cli/Cargo.lock
          '';

          meta = {
            description = "A simple, secure, and fast identity management platform";
            homepage = "https://github.com/kanidm/kanidm";
            license = pkgs.lib.licenses.mpl20;
            maintainers = [ ];
          };
        };
        #########  End of addition

      in
      with pkgs;
      {

@kadaan
Copy link
Author

kadaan commented Dec 3, 2024

2024-12-03 at 17 23 11

@kadaan
Copy link
Author

kadaan commented Dec 3, 2024

What commands are you using out of the iproute2 package?

@khuedoan
Copy link
Owner

khuedoan commented Dec 7, 2024

iproute2 is used for the PXE boot setup to provision bare metal servers, I don’t have a macOS machine to test, but for the development sandbox, you might be able to get away without it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants