-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add darwin test configurations (#525)
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
inputs, | ||
prefix, | ||
self, | ||
pkgs, | ||
}: | ||
let | ||
lib = pkgs.lib; | ||
|
||
darwinConfigurations = import ./darwin-test-configurations.nix { inherit inputs self pkgs; }; | ||
|
||
darwinChecks = lib.mapAttrs' (name: value: { | ||
name = "${prefix}-${name}"; | ||
value = value.config.system.build.toplevel; | ||
}) (lib.filterAttrs (_name: value: value != null) darwinConfigurations); | ||
in | ||
darwinChecks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# We use the darwinConfigurations to test all the modules below. | ||
# | ||
# This is not optimal, but it gets the job done | ||
{ | ||
inputs, | ||
self, | ||
pkgs, | ||
}: | ||
let | ||
lib = pkgs.lib; | ||
|
||
darwinSystem = | ||
args: import "${toString inputs.nix-darwin}/eval-config.nix" ({ inherit lib; } // args); | ||
|
||
# some example configuration to make it eval | ||
dummy = | ||
{ config, ... }: | ||
{ | ||
networking.hostName = "example-common"; | ||
system.stateVersion = 5; | ||
|
||
# Don't reinstantiate nixpkgs for every eval. | ||
# Also important to have nixpkgs config which allows for some required insecure packages | ||
nixpkgs = { | ||
inherit pkgs; | ||
}; | ||
}; | ||
in | ||
{ | ||
# General | ||
example-common = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.common | ||
]; | ||
}; | ||
example-server = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.server | ||
]; | ||
}; | ||
example-desktop = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.desktop | ||
]; | ||
}; | ||
example-mixins-terminfo = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.mixins-terminfo | ||
]; | ||
}; | ||
example-mixins-telegraf = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.mixins-telegraf | ||
]; | ||
}; | ||
example-mixins-trusted-nix-caches = darwinSystem { | ||
modules = [ | ||
dummy | ||
self.darwinModules.mixins-trusted-nix-caches | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters