mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-15 21:08:21 +00:00
make nixpkgs and system overridable for ./release.nix
This commit is contained in:
parent
54a3bf8eb2
commit
b1a264c928
3 changed files with 47 additions and 12 deletions
19
default.nix
19
default.nix
|
@ -1,11 +1,23 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, configuration ? <darwin-config> }:
|
{ nixpkgs ? <nixpkgs>, configuration ? <darwin-config>, system ? builtins.currentSystem
|
||||||
|
, pkgs ? import nixpkgs { inherit system; }
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
packages = { config, lib, pkgs, ... }: {
|
||||||
|
config = {
|
||||||
|
_module.args.pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
inherit (config.nixpkgs) config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
eval = pkgs.lib.evalModules {
|
eval = pkgs.lib.evalModules {
|
||||||
check = true;
|
check = true;
|
||||||
modules =
|
modules =
|
||||||
[ configuration
|
[ configuration
|
||||||
|
packages
|
||||||
./modules/alias.nix
|
./modules/alias.nix
|
||||||
./modules/system
|
./modules/system
|
||||||
./modules/system/activation-scripts.nix
|
./modules/system/activation-scripts.nix
|
||||||
|
@ -33,12 +45,11 @@ let
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
system = eval.config.system.build.toplevel;
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
inherit (eval.config._module.args) pkgs;
|
inherit (eval.config._module.args) pkgs;
|
||||||
inherit (eval) options config;
|
inherit (eval) options config;
|
||||||
inherit system;
|
|
||||||
|
system = eval.config.system.build.toplevel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,9 +67,7 @@ in
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
_module.args.pkgs = import <nixpkgs> {
|
# _module.args.pkgs is defined in ../../default.nix
|
||||||
inherit (config.nixpkgs) config;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
36
release.nix
36
release.nix
|
@ -5,10 +5,12 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (release) mapTestOn packagePlatforms pkgs;
|
inherit (release) mapTestOn packagePlatforms pkgs all linux darwin;
|
||||||
|
|
||||||
|
mapPlatforms = systems: pkgs.lib.mapAttrs (n: v: systems);
|
||||||
|
|
||||||
genExample = configuration: pkgs.lib.genAttrs [ "x86_64-darwin" ] (system:
|
genExample = configuration: pkgs.lib.genAttrs [ "x86_64-darwin" ] (system:
|
||||||
(import ./. { pkgs = import nixpkgs { inherit system; }; inherit configuration; }).system
|
(import ./. { inherit nixpkgs configuration system; }).system
|
||||||
);
|
);
|
||||||
|
|
||||||
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
|
release = import <nixpkgs/pkgs/top-level/release-lib.nix> {
|
||||||
|
@ -17,7 +19,21 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
packageSet = {
|
packageSet = {
|
||||||
inherit (pkgs) stdenv bash zsh nix nix-repl vim tmux reattach-to-user-namespace;
|
# stdenv
|
||||||
|
inherit (pkgs)
|
||||||
|
autoconf automake bison bzip2 clang cmake coreutils cpio ed findutils flex gawk gettext gmp
|
||||||
|
gnugrep gnum4 gnumake gnused groff gzip help2man libcxx libcxxabi libedit libffi libtool
|
||||||
|
libxml2 llvm ncurses patch pcre perl pkgconfig python unzip xz zlib;
|
||||||
|
perlPackages = { inherit (pkgs.perlPackages) LocaleGettext; };
|
||||||
|
darwin = {
|
||||||
|
inherit (pkgs.darwin)
|
||||||
|
CF CarbonHeaders CommonCrypto Csu IOKit Libinfo Libm Libnotify Libsystem adv_cmds
|
||||||
|
architecture bootstrap_cmds bsdmake cctools configd copyfile dyld eap8021x launchd
|
||||||
|
libclosure libdispatch libiconv libpthread libresolv libutil objc4 ppp removefile xnu;
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit (pkgs)
|
||||||
|
stdenv bash zsh nix nix-repl nano vim emacs tmux reattach-to-user-namespace;
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs = {
|
jobs = {
|
||||||
|
@ -27,17 +43,27 @@ let
|
||||||
constituents =
|
constituents =
|
||||||
[ jobs.stdenv.x86_64-darwin
|
[ jobs.stdenv.x86_64-darwin
|
||||||
jobs.bash.x86_64-darwin
|
jobs.bash.x86_64-darwin
|
||||||
|
jobs.zsh.x86_64-darwin
|
||||||
|
jobs.nix-repl.x86_64-darwin
|
||||||
|
jobs.nix.x86_64-darwin
|
||||||
|
jobs.reattach-to-user-namespace.x86_64-darwin
|
||||||
|
jobs.tmux.x86_64-darwin
|
||||||
|
jobs.nano.x86_64-darwin
|
||||||
|
jobs.vim.x86_64-darwin
|
||||||
|
jobs.emacs.x86_64-darwin
|
||||||
jobs.examples.lnl.x86_64-darwin
|
jobs.examples.lnl.x86_64-darwin
|
||||||
jobs.examples.simple.x86_64-darwin
|
jobs.examples.simple.x86_64-darwin
|
||||||
];
|
];
|
||||||
meta.description = "Release-critical builds for the Nixpkgs unstable channel";
|
meta.description = "Release-critical builds for the darwin unstable channel";
|
||||||
};
|
};
|
||||||
|
|
||||||
examples.lnl = genExample ./modules/examples/lnl.nix;
|
examples.lnl = genExample ./modules/examples/lnl.nix;
|
||||||
examples.simple = genExample ./modules/examples/simple.nix;
|
examples.simple = genExample ./modules/examples/simple.nix;
|
||||||
|
|
||||||
}
|
}
|
||||||
// (mapTestOn (packagePlatforms packageSet));
|
// (mapTestOn (packagePlatforms packageSet))
|
||||||
|
// (mapTestOn { perlPackages = mapPlatforms all packageSet.perlPackages; })
|
||||||
|
// (mapTestOn { darwin = mapPlatforms darwin packageSet.darwin; });
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue