1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00
nix-darwin/release.nix

107 lines
3.1 KiB
Nix
Raw Normal View History

2017-01-15 01:05:55 +01:00
{ nixpkgs ? <nixpkgs>
, supportedSystems ? [ "x86_64-darwin" ]
, scrubJobs ? true
}:
let
inherit (release) mapTestOn packagePlatforms pkgs all linux darwin;
mapPlatforms = systems: pkgs.lib.mapAttrs (n: v: systems);
2017-01-15 01:05:55 +01:00
genExample = configuration: pkgs.lib.genAttrs [ "x86_64-darwin" ] (system:
(import ./. { inherit nixpkgs configuration system; }).system
2017-01-15 01:05:55 +01:00
);
2017-03-11 10:03:37 +01:00
makeTest = test:
2017-11-05 22:55:16 +01:00
let
configuration =
{ config, lib, pkgs, ... }:
with lib;
{ imports = [ test ];
2017-03-11 10:03:37 +01:00
2017-11-05 22:55:16 +01:00
options = {
out = mkOption {
type = types.package;
};
2017-03-11 10:03:37 +01:00
2017-11-05 22:55:16 +01:00
test = mkOption {
type = types.lines;
2017-03-11 10:03:37 +01:00
};
2017-11-05 22:55:16 +01:00
};
2017-03-11 10:03:37 +01:00
2017-11-05 22:55:16 +01:00
config = {
system.build.run-test = pkgs.runCommand "run-darwin-test"
{ allowSubstitutes = false;
preferLocalBuild = true;
}
''
#! ${pkgs.stdenv.shell}
set -e
2017-03-11 10:03:37 +01:00
2017-11-05 22:55:16 +01:00
${config.test}
echo ok >&2
touch $out
'';
2017-03-11 10:03:37 +01:00
2017-11-05 22:55:16 +01:00
out = config.system.build.toplevel;
2017-03-11 10:03:37 +01:00
};
2017-11-05 22:55:16 +01:00
};
system = "x86_64-darwin";
in
(import ./. { inherit nixpkgs configuration system; }).config.system.build.run-test;
2017-03-11 10:03:37 +01:00
2017-01-15 01:05:55 +01:00
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
inherit supportedSystems scrubJobs;
packageSet = import nixpkgs;
};
packageSet = {
inherit (pkgs)
2017-02-19 16:25:51 +01:00
stdenv bash zsh nix nix-repl
tmux reattach-to-user-namespace
nano emacs vim;
2017-01-15 01:05:55 +01:00
};
jobs = {
unstable = pkgs.releaseTools.aggregate {
name = "darwin-${pkgs.lib.nixpkgsVersion}";
constituents =
[ jobs.stdenv.x86_64-darwin
jobs.bash.x86_64-darwin
jobs.zsh.x86_64-darwin
jobs.nix.x86_64-darwin
2017-02-19 16:25:51 +01:00
jobs.nix-repl.x86_64-darwin
2017-01-15 10:39:38 +01:00
# jobs.reattach-to-user-namespace.x86_64-darwin license?
jobs.tmux.x86_64-darwin
jobs.nano.x86_64-darwin
jobs.vim.x86_64-darwin
jobs.emacs.x86_64-darwin
2017-07-17 23:43:24 +02:00
jobs.examples.hydra.x86_64-darwin
2017-01-15 01:26:36 +01:00
jobs.examples.lnl.x86_64-darwin
jobs.examples.simple.x86_64-darwin
2017-01-15 01:05:55 +01:00
];
meta.description = "Release-critical builds for the darwin unstable channel";
2017-01-15 01:05:55 +01:00
};
2017-07-17 23:43:24 +02:00
examples.hydra = genExample ./modules/examples/hydra.nix;
2017-01-15 01:05:55 +01:00
examples.lnl = genExample ./modules/examples/lnl.nix;
examples.simple = genExample ./modules/examples/simple.nix;
tests.environment-path = makeTest ./tests/environment-path.nix;
tests.launchd-setenv = makeTest ./tests/launchd-setenv.nix;
2017-05-14 01:19:07 +02:00
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
2017-05-14 01:00:29 +02:00
tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix;
2017-03-11 10:03:37 +01:00
tests.system-packages = makeTest ./tests/system-packages.nix;
2017-03-11 22:28:51 +01:00
tests.system-path-bash = makeTest ./tests/system-path-bash.nix;
tests.system-path-fish = makeTest ./tests/system-path-fish.nix;
tests.system-path-zsh = makeTest ./tests/system-path-zsh.nix;
2017-12-13 23:05:46 +01:00
tests.system-shells = makeTest ./tests/system-shells.nix;
2017-03-11 10:03:37 +01:00
2017-01-15 01:05:55 +01:00
}
2017-02-19 16:40:32 +01:00
// (mapTestOn (packagePlatforms packageSet));
2017-01-15 01:05:55 +01:00
in
jobs