ci: Pass system through attribute

This commit is contained in:
Zhaofeng Li
2024-11-15 08:33:25 -07:00
parent 6a229f1d7b
commit 280bf59451
3 changed files with 8 additions and 9 deletions
+3 -2
View File
@@ -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"
+2 -4
View File
@@ -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 = [
+3 -3
View File
@@ -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;
};
};
}