diff options
| author | Michael Hoang <enzime@users.noreply.github.com> | 2023-09-28 01:49:38 +0100 |
|---|---|---|
| committer | Michael Hoang <enzime@users.noreply.github.com> | 2023-09-29 12:38:39 +0100 |
| commit | 70af808347fbfd866e04da5fe2856cb1ae75eaa4 (patch) | |
| tree | 4a99bf7fc4cab9bb198402f80104f4167085bed3 /modules/nix | |
| parent | 829041cf10c4f6751a53c0a11ca2fd22ff0918d6 (diff) | |
linux-builder: change from `modules` to `config`
Using the type `deferredModule` fixes `pkgs` not being accessible as a
module argument (apart from `config._module.args.pkgs`).
Diffstat (limited to 'modules/nix')
| -rw-r--r-- | modules/nix/linux-builder.nix | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/nix/linux-builder.nix b/modules/nix/linux-builder.nix index 0d473d3..42bd2e0 100644 --- a/modules/nix/linux-builder.nix +++ b/modules/nix/linux-builder.nix @@ -8,11 +8,15 @@ let cfg = config.nix.linux-builder; builderWithOverrides = cfg.package.override { - inherit (cfg) modules; + modules = [ cfg.config ]; }; 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"); @@ -25,21 +29,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. ''; }; |
