mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
nix-darwin,nixos: add osConfig module argument (#2302)
Having either argument defined based on the OS is a problem when
trying to write generic Nix code.
The current workaround is to use accept both and specify a default
value for each argument:
```
{ config, lib, nixosConfig ? {}, darwinConfig ? {}, ... }:
let
osConfig = nixosConfig // darwinConfig;
in
{
# Do something with `osConfig`
}
```
With this commit, it becomes possible to do the following:
```
{ config, lib, osConfig, ... }:
{
# Do something with `osConfig`
}
```
This commit is contained in:
parent
854406680b
commit
60ebc273c9
2 changed files with 2 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ let
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
lib = extendedLib;
|
lib = extendedLib;
|
||||||
darwinConfig = config;
|
darwinConfig = config;
|
||||||
|
osConfig = config;
|
||||||
} // cfg.extraSpecialArgs;
|
} // cfg.extraSpecialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
({ name, ... }: {
|
({ name, ... }: {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ let
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
lib = extendedLib;
|
lib = extendedLib;
|
||||||
nixosConfig = config;
|
nixosConfig = config;
|
||||||
|
osConfig = config;
|
||||||
modulesPath = ../modules;
|
modulesPath = ../modules;
|
||||||
} // cfg.extraSpecialArgs;
|
} // cfg.extraSpecialArgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue