mirror of
https://github.com/nix-community/srvos.git
synced 2024-11-20 19:38:59 +03:00
add darwin test configurations (#525)
This commit is contained in:
parent
ce661d208f
commit
8cf7a278fe
17
dev/darwin-checks.nix
Normal file
17
dev/darwin-checks.nix
Normal file
@ -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
|
67
dev/darwin-test-configurations.nix
Normal file
67
dev/darwin-test-configurations.nix
Normal file
@ -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
|
||||
];
|
||||
};
|
||||
}
|
@ -60,6 +60,12 @@
|
||||
inherit (self') formatter;
|
||||
}
|
||||
// packages
|
||||
// (lib.optionalAttrs (pkgs.stdenv.hostPlatform.system == "aarch64-darwin") (
|
||||
import ./dev/darwin-checks.nix {
|
||||
inherit inputs self pkgs;
|
||||
prefix = "darwin";
|
||||
}
|
||||
))
|
||||
// (lib.optionalAttrs isLinux (
|
||||
import ./dev/checks.nix {
|
||||
inherit self pkgs;
|
||||
|
Loading…
Reference in New Issue
Block a user