2017-01-15 00:05:55 +00:00
|
|
|
{ nixpkgs ? <nixpkgs>
|
|
|
|
, supportedSystems ? [ "x86_64-darwin" ]
|
|
|
|
, scrubJobs ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2017-01-15 08:51:00 +00:00
|
|
|
inherit (release) mapTestOn packagePlatforms pkgs all linux darwin;
|
|
|
|
|
2019-05-04 13:39:32 +00:00
|
|
|
system = "x86_64-darwin";
|
|
|
|
|
2017-01-15 08:51:00 +00:00
|
|
|
mapPlatforms = systems: pkgs.lib.mapAttrs (n: v: systems);
|
2017-01-15 00:05:55 +00:00
|
|
|
|
2019-05-04 13:39:32 +00:00
|
|
|
buildFromConfig = configuration: sel: sel
|
|
|
|
(import ./. { inherit nixpkgs configuration system; }).config;
|
|
|
|
|
|
|
|
makeSystem = configuration: pkgs.lib.genAttrs [ system ] (system:
|
|
|
|
buildFromConfig configuration (config: config.system.build.toplevel)
|
2017-01-15 00:05:55 +00:00
|
|
|
);
|
|
|
|
|
2017-03-11 09:03:37 +00:00
|
|
|
makeTest = test:
|
2017-11-05 21:55:16 +00:00
|
|
|
let
|
2023-08-03 08:47:40 +00:00
|
|
|
testName =
|
|
|
|
builtins.replaceStrings [ ".nix" ] [ "" ]
|
|
|
|
(builtins.baseNameOf test);
|
|
|
|
|
2017-11-05 21:55:16 +00:00
|
|
|
configuration =
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
2018-01-14 20:08:28 +00:00
|
|
|
{
|
|
|
|
imports = [ test ];
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-11-05 21:55:16 +00:00
|
|
|
options = {
|
|
|
|
out = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
};
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-11-05 21:55:16 +00:00
|
|
|
test = mkOption {
|
|
|
|
type = types.lines;
|
2017-03-11 09:03:37 +00:00
|
|
|
};
|
2017-11-05 21:55:16 +00:00
|
|
|
};
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-11-05 21:55:16 +00:00
|
|
|
config = {
|
2024-09-12 16:21:48 +00:00
|
|
|
system.stateVersion = lib.mkDefault config.system.maxStateVersion;
|
|
|
|
|
2023-08-03 08:47:40 +00:00
|
|
|
system.build.run-test = pkgs.runCommand "darwin-test-${testName}"
|
2018-01-14 20:08:28 +00:00
|
|
|
{ allowSubstitutes = false; preferLocalBuild = true; }
|
2017-11-05 21:55:16 +00:00
|
|
|
''
|
|
|
|
#! ${pkgs.stdenv.shell}
|
|
|
|
set -e
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2018-01-14 20:08:28 +00:00
|
|
|
echo >&2 "running tests for system ${config.out}"
|
|
|
|
echo >&2
|
2017-11-05 21:55:16 +00:00
|
|
|
${config.test}
|
2018-01-14 20:08:28 +00:00
|
|
|
echo >&2 ok
|
2017-11-05 21:55:16 +00:00
|
|
|
touch $out
|
|
|
|
'';
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-11-05 21:55:16 +00:00
|
|
|
out = config.system.build.toplevel;
|
2017-03-11 09:03:37 +00:00
|
|
|
};
|
2017-11-05 21:55:16 +00:00
|
|
|
};
|
|
|
|
in
|
2019-05-04 13:39:32 +00:00
|
|
|
buildFromConfig configuration (config: config.system.build.run-test);
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-01-15 00:05:55 +00:00
|
|
|
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
|
|
|
|
inherit supportedSystems scrubJobs;
|
|
|
|
packageSet = import nixpkgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
packageSet = {
|
2017-01-15 08:51:00 +00:00
|
|
|
inherit (pkgs)
|
2018-08-21 20:42:33 +00:00
|
|
|
stdenv bash zsh nix
|
2017-02-19 15:25:51 +00:00
|
|
|
tmux reattach-to-user-namespace
|
|
|
|
nano emacs vim;
|
2017-01-15 00:05:55 +00:00
|
|
|
};
|
|
|
|
|
2024-09-12 16:21:48 +00:00
|
|
|
manual = buildFromConfig ({ lib, config, ... }: {
|
|
|
|
system.stateVersion = lib.mkDefault config.system.maxStateVersion;
|
|
|
|
}) (config: config.system.build.manual);
|
|
|
|
|
2017-01-15 00:05:55 +00:00
|
|
|
jobs = {
|
|
|
|
|
|
|
|
unstable = pkgs.releaseTools.aggregate {
|
|
|
|
name = "darwin-${pkgs.lib.nixpkgsVersion}";
|
|
|
|
constituents =
|
|
|
|
[ jobs.stdenv.x86_64-darwin
|
|
|
|
jobs.bash.x86_64-darwin
|
2017-01-15 08:51:00 +00:00
|
|
|
jobs.zsh.x86_64-darwin
|
|
|
|
jobs.nix.x86_64-darwin
|
2018-01-14 20:08:28 +00:00
|
|
|
jobs.reattach-to-user-namespace.x86_64-darwin
|
2017-01-15 08:51:00 +00:00
|
|
|
jobs.tmux.x86_64-darwin
|
|
|
|
jobs.nano.x86_64-darwin
|
|
|
|
jobs.vim.x86_64-darwin
|
|
|
|
jobs.emacs.x86_64-darwin
|
2017-07-17 21:43:24 +00:00
|
|
|
jobs.examples.hydra.x86_64-darwin
|
2017-01-15 00:26:36 +00:00
|
|
|
jobs.examples.lnl.x86_64-darwin
|
|
|
|
jobs.examples.simple.x86_64-darwin
|
2017-01-15 00:05:55 +00:00
|
|
|
];
|
2018-01-14 20:08:28 +00:00
|
|
|
meta.description = "Release-critical builds for the darwin channel";
|
2017-01-15 00:05:55 +00:00
|
|
|
};
|
|
|
|
|
2024-09-12 16:21:48 +00:00
|
|
|
manualHTML = manual.manualHTML;
|
|
|
|
manpages = manual.manpages;
|
|
|
|
options = manual.optionsJSON;
|
2019-05-04 13:39:32 +00:00
|
|
|
|
|
|
|
examples.hydra = makeSystem ./modules/examples/hydra.nix;
|
|
|
|
examples.lnl = makeSystem ./modules/examples/lnl.nix;
|
|
|
|
examples.simple = makeSystem ./modules/examples/simple.nix;
|
2017-01-15 00:05:55 +00:00
|
|
|
|
2018-01-14 13:30:27 +00:00
|
|
|
tests.activation-scripts = makeTest ./tests/activation-scripts.nix;
|
2019-06-24 15:43:01 +00:00
|
|
|
tests.autossh = makeTest ./tests/autossh.nix;
|
2019-01-03 23:50:14 +00:00
|
|
|
tests.checks-nix-gc = makeTest ./tests/checks-nix-gc.nix;
|
2017-05-15 18:35:30 +00:00
|
|
|
tests.environment-path = makeTest ./tests/environment-path.nix;
|
2022-10-19 21:09:28 +00:00
|
|
|
tests.environment-terminfo = makeTest ./tests/environment-terminfo.nix;
|
2022-08-23 22:21:09 +00:00
|
|
|
tests.homebrew = makeTest ./tests/homebrew.nix;
|
2019-03-22 19:49:53 +00:00
|
|
|
tests.launchd-daemons = makeTest ./tests/launchd-daemons.nix;
|
2017-05-15 22:11:05 +00:00
|
|
|
tests.launchd-setenv = makeTest ./tests/launchd-setenv.nix;
|
2018-01-07 23:25:26 +00:00
|
|
|
tests.networking-hostname = makeTest ./tests/networking-hostname.nix;
|
|
|
|
tests.networking-networkservices = makeTest ./tests/networking-networkservices.nix;
|
2018-01-06 23:06:53 +00:00
|
|
|
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
|
2018-03-06 20:21:25 +00:00
|
|
|
tests.programs-ssh = makeTest ./tests/programs-ssh.nix;
|
2019-11-02 16:18:39 +00:00
|
|
|
tests.programs-tmux = makeTest ./tests/programs-tmux.nix;
|
2018-01-20 22:00:24 +00:00
|
|
|
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
2020-04-06 02:48:56 +00:00
|
|
|
tests.programs-ssh-empty-known-hosts = makeTest ./tests/programs-ssh-empty-known-hosts.nix;
|
2019-01-15 21:14:56 +00:00
|
|
|
tests.security-pki = makeTest ./tests/security-pki.nix;
|
2017-05-13 23:19:07 +00:00
|
|
|
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
|
2020-04-14 21:53:31 +00:00
|
|
|
tests.services-activate-system-changed-label-prefix = makeTest ./tests/services-activate-system-changed-label-prefix.nix;
|
2018-03-05 20:46:12 +00:00
|
|
|
tests.services-buildkite-agent = makeTest ./tests/services-buildkite-agent.nix;
|
2022-11-20 13:00:00 +00:00
|
|
|
tests.services-github-runners = makeTest ./tests/services-github-runners.nix;
|
2020-05-12 17:20:29 +00:00
|
|
|
tests.services-lorri = makeTest ./tests/services-lorri.nix;
|
2018-06-21 13:22:12 +00:00
|
|
|
tests.services-nix-daemon = makeTest ./tests/services-nix-daemon.nix;
|
|
|
|
tests.sockets-nix-daemon = makeTest ./tests/sockets-nix-daemon.nix;
|
2020-04-28 17:06:45 +00:00
|
|
|
tests.services-dnsmasq = makeTest ./tests/services-dnsmasq.nix;
|
2023-07-23 12:20:28 +00:00
|
|
|
tests.services-eternal-terminal = makeTest ./tests/services-eternal-terminal.nix;
|
2019-01-03 19:58:57 +00:00
|
|
|
tests.services-nix-gc = makeTest ./tests/services-nix-gc.nix;
|
2024-03-25 23:34:10 +00:00
|
|
|
tests.services-nix-optimise = makeTest ./tests/services-nix-optimise.nix;
|
2020-11-27 02:28:26 +00:00
|
|
|
tests.services-nextdns = makeTest ./tests/services-nextdns.nix;
|
2018-03-05 22:00:50 +00:00
|
|
|
tests.services-ofborg = makeTest ./tests/services-ofborg.nix;
|
2018-06-04 11:04:16 +00:00
|
|
|
tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix;
|
2020-04-28 17:06:45 +00:00
|
|
|
tests.services-privoxy = makeTest ./tests/services-privoxy.nix;
|
2020-11-03 03:26:39 +00:00
|
|
|
tests.services-redis = makeTest ./tests/services-redis.nix;
|
2018-03-05 20:41:52 +00:00
|
|
|
tests.services-skhd = makeTest ./tests/services-skhd.nix;
|
2020-05-14 14:09:40 +00:00
|
|
|
tests.services-spacebar = makeTest ./tests/services-spacebar.nix;
|
2021-03-11 04:20:00 +00:00
|
|
|
tests.services-spotifyd = makeTest ./tests/services-spotifyd.nix;
|
2018-09-15 20:27:41 +00:00
|
|
|
tests.services-synapse-bt = makeTest ./tests/services-synapse-bt.nix;
|
2018-09-14 11:01:08 +00:00
|
|
|
tests.services-synergy = makeTest ./tests/services-synergy.nix;
|
2020-05-06 16:21:46 +00:00
|
|
|
tests.services-yabai = makeTest ./tests/services-yabai.nix;
|
2024-06-11 18:32:21 +00:00
|
|
|
tests.services-jankyborders = makeTest ./tests/services-jankyborders.nix;
|
2017-05-13 23:00:29 +00:00
|
|
|
tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix;
|
2018-10-29 00:12:20 +00:00
|
|
|
tests.system-environment = makeTest ./tests/system-environment.nix;
|
2018-01-08 21:21:57 +00:00
|
|
|
tests.system-keyboard-mapping = makeTest ./tests/system-keyboard-mapping.nix;
|
2017-03-11 09:03:37 +00:00
|
|
|
tests.system-packages = makeTest ./tests/system-packages.nix;
|
2018-10-24 15:30:34 +00:00
|
|
|
tests.system-path = makeTest ./tests/system-path.nix;
|
2017-12-13 22:05:46 +00:00
|
|
|
tests.system-shells = makeTest ./tests/system-shells.nix;
|
2018-01-13 01:05:45 +00:00
|
|
|
tests.users-groups = makeTest ./tests/users-groups.nix;
|
2019-02-20 16:39:12 +00:00
|
|
|
tests.users-packages = makeTest ./tests/users-packages.nix;
|
2018-09-30 17:42:00 +00:00
|
|
|
tests.fonts = makeTest ./tests/fonts.nix;
|
2017-03-11 09:03:37 +00:00
|
|
|
|
2017-01-15 00:05:55 +00:00
|
|
|
}
|
2017-02-19 15:40:32 +00:00
|
|
|
// (mapTestOn (packagePlatforms packageSet));
|
2017-01-15 00:05:55 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
jobs
|