1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

Merge pull request #785 from Enzime/deferred-modules

linux-builder: change from `modules` to `config`
This commit is contained in:
Domen Kožar 2023-11-08 09:58:53 +00:00 committed by GitHub
commit eb2b9b6423
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ let
cfg = config.nix.linux-builder;
builderWithOverrides = cfg.package.override {
inherit (cfg) modules;
modules = [ cfg.config ];
};
# create-builder uses TMPDIR to share files with the builder, notably certs.
@ -25,6 +25,10 @@ let
in
{
imports = [
(mkRemovedOptionModule [ "nix" "linux-builder" "modules" ] "This option has been replaced with `nix.linux-builder.config` which allows setting options directly like `nix.linux-builder.config.networking.hostName = \"banana\";.")
];
options.nix.linux-builder = {
enable = mkEnableOption (lib.mdDoc "Linux builder");
@ -37,21 +41,19 @@ in
'';
};
modules = mkOption {
type = types.listOf types.anything;
default = [ ];
config = mkOption {
type = types.deferredModule;
default = { };
example = literalExpression ''
[
({ config, ... }:
({ pkgs, ... }:
{
virtualisation.darwin-builder.hostPort = 22;
})
]
{
environment.systemPackages = [ pkgs.neovim ];
})
'';
description = lib.mdDoc ''
This option specifies extra NixOS modules and configuration for the builder. You should first run the Linux builder
without changing this option otherwise you may not be able to build the Linux builder.
This option specifies extra NixOS configuration for the builder. You should first use the Linux builder
without changing the builder configuration otherwise you may not be able to build the Linux builder.
'';
};