From 5d8ad87e44bab6ac03f479a96dcb7459b1879caf Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 15 Nov 2024 08:33:25 -0700 Subject: [PATCH 1/5] .github: Update CI runner to macos-latest --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6ed3f80..df86821 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,7 +6,7 @@ on: jobs: check: - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v3 - uses: DeterminateSystems/nix-installer-action@main From 2eea1d33ec0411780813266894660902152733c7 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 15 Nov 2024 08:33:25 -0700 Subject: [PATCH 2/5] Fix tty color --- modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default.nix b/modules/default.nix index cfda92c..1b8ccec 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -178,7 +178,7 @@ let if test -n "${toString cfg.enableRosetta}" && ! pgrep -q oahd; then warn "The Intel Homebrew prefix has been set up, but Rosetta isn't installed yet." - ohai 'Run ''${tty_bold}softwareupdate --install-rosetta''${tty_reset} to install it.' + ohai "Run ''${tty_bold}softwareupdate --install-rosetta''${tty_reset} to install it." fi ''; From 6a229f1d7b8295c6b5d1ccc457f5b1dcb926e8b4 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 15 Nov 2024 08:33:25 -0700 Subject: [PATCH 3/5] ci: Delete stray files --- .gitignore | 2 ++ ci/example.json | 1 - ci/step.json | 1 - ci/system.json | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 ci/example.json delete mode 100644 ci/step.json delete mode 100644 ci/system.json diff --git a/.gitignore b/.gitignore index 779fc7c..467ae93 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ result* +/ci/*.json + *.o *.out diff --git a/ci/example.json b/ci/example.json deleted file mode 100644 index 219f6a5..0000000 --- a/ci/example.json +++ /dev/null @@ -1 +0,0 @@ -migrate diff --git a/ci/step.json b/ci/step.json deleted file mode 100644 index b9104a5..0000000 --- a/ci/step.json +++ /dev/null @@ -1 +0,0 @@ -"migrate" diff --git a/ci/system.json b/ci/system.json deleted file mode 100644 index 54d5bb5..0000000 --- a/ci/system.json +++ /dev/null @@ -1 +0,0 @@ -"aarch64-darwin" From 280bf59451bfef004db7b8e5a9b5de0d467d39a3 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 15 Nov 2024 08:33:25 -0700 Subject: [PATCH 4/5] ci: Pass system through attribute --- ci/activate-example.sh | 5 +++-- ci/default.nix | 6 ++---- flake.nix | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ci/activate-example.sh b/ci/activate-example.sh index 3ae0c42..fec27e1 100755 --- a/ci/activate-example.sh +++ b/ci/activate-example.sh @@ -9,9 +9,10 @@ if [[ "$#" != "1" ]]; then fi example="$1" -nix-instantiate --eval --json -E 'builtins.currentSystem' >"${DIR}/system.json" -systemProfile=$(nix build "./${DIR}/..#darwinConfigurations.ci.${example}.system" -L --no-link --print-out-paths) +system="$(nix eval --raw --impure --expr 'builtins.currentSystem')" +>&2 echo "System: ${system}" +systemProfile="$(nix build "./${DIR}/..#ci.${system}.${example}.system" -L --no-link --print-out-paths)" >&2 echo "Built $systemProfile" sudo rm "/etc/nix/nix.conf" diff --git a/ci/default.nix b/ci/default.nix index 9fefe77..0449959 100644 --- a/ci/default.nix +++ b/ci/default.nix @@ -1,11 +1,9 @@ # Activates example configurations on CI -{ self, nix-darwin, nixpkgs, ... }: +{ self, pkgs, nix-darwin, ... }: let - system = builtins.fromJSON (builtins.readFile ./system.json); - pkgs = nixpkgs.legacyPackages.${system}; - inherit (pkgs) lib; + inherit (pkgs) lib system; makeProfile = example: nix-darwin.lib.darwinSystem { inherit system pkgs; modules = [ diff --git a/flake.nix b/flake.nix index 1ea684b..ce0f4f6 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,9 @@ BREW_SRC = brew-src; }; + ci = import ./ci (inputs // { + inherit pkgs; + }); }) // { darwinModules = { nix-homebrew = { lib, ... }: { @@ -41,8 +44,5 @@ }); }; }; - darwinConfigurations = { - ci = import ./ci inputs; - }; }; } From 6e20c028b2a8650444207fac3a668f064d23d025 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 15 Nov 2024 08:33:25 -0700 Subject: [PATCH 5/5] examples/migrate: Enable Rosetta --- examples/migrate.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/migrate.nix b/examples/migrate.nix index d028816..b5c18f3 100644 --- a/examples/migrate.nix +++ b/examples/migrate.nix @@ -4,6 +4,7 @@ { nix-homebrew = { enable = true; + enableRosetta = true; autoMigrate = true; user = "yourname"; };