Skip to content

Commit

Permalink
ci: Pass system through attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaofengli committed Nov 15, 2024
1 parent ca8c588 commit 4b7c22e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions ci/activate-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-instantiate --eval --json -E '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"
Expand Down
6 changes: 2 additions & 4 deletions ci/default.nix
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

BREW_SRC = brew-src;
};
ci = import ./ci (inputs // {
inherit pkgs;
});
}) // {
darwinModules = {
nix-homebrew = { lib, ... }: {
Expand All @@ -41,8 +44,5 @@
});
};
};
darwinConfigurations = {
ci = import ./ci inputs;
};
};
}

0 comments on commit 4b7c22e

Please sign in to comment.