From 38ba89a0602950fff57b2cf20433bc4844006292 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 21 Aug 2025 18:00:26 -0500 Subject: [PATCH] Make it possible to get installed on Darwin --- flake.lock | 6 +++--- flake.nix | 36 +++++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 25bca50..584c77d 100644 --- a/flake.lock +++ b/flake.lock @@ -108,11 +108,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1755577059, - "narHash": "sha256-5hYhxIpco8xR+IpP3uU56+4+Bw7mf7EMyxS/HqUYHQY=", + "lastModified": 1755736253, + "narHash": "sha256-jlIQRypNhB1PcB1BE+expE4xZeJxzoAGr1iUbHQta8s=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "97eb7ee0da337d385ab015a23e15022c865be75c", + "rev": "596312aae91421d6923f18cecce934a7d3bfd6b8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a8d7980..18ba477 100644 --- a/flake.nix +++ b/flake.nix @@ -56,6 +56,11 @@ _module.args.pkgs = import inputs.nixpkgs { inherit system; config.allowUnfree = true; + overlays = [ + (_f: p: { + OVMF = p.OVMF.overrideAttrs { meta.broken = false; }; + }) + ]; }; devShells.default = pkgs.mkShell { @@ -63,10 +68,13 @@ shellHook = self'.checks.pre-commit.shellHook; packages = - (with pkgs; [ - packer - vagrant - ]) + ( + with pkgs; + [ + packer + ] + ++ lib.optional (!pkgs.stdenv.isDarwin) vagrant + ) ++ (with self'.packages; [ cache generate @@ -77,7 +85,7 @@ # These commands will be shown in the motd that users read # upon entering the shell env = { - EFI_DIR = "${pkgs.OVMF.fd}/FV/"; + EFI_DIR = if pkgs.stdenv.isDarwin then "" else "${pkgs.OVMF.fd}/FV/"; PACKER_CONFIG_DIR = "./packer_config"; STORAGE_URL = "s3.thehellings.lan:9000"; }; @@ -90,14 +98,16 @@ prefix: d: args: pkgs.writeShellApplication { name = "${prefix}${name d}"; - runtimeInputs = with pkgs; [ - cdrtools - findutils - packer - qemu_full - vagrant - xorriso - ]; + runtimeInputs = + with pkgs; + [ + cdrtools + findutils + packer + qemu_full + xorriso + ] + ++ lib.optional (!pkgs.stdenv.isDarwin) vagrant; text = '' # This is a workaround for a goofy behavior in CI if [ -e "''${PACKER_CONFIG_DIR}" ]; then